SwiperRefreshLayout箭头指示器未显示

时间:2015-11-16 16:44:03

标签: android android-recyclerview swiperefreshlayout

我有这个问题,我第一次向下滑动以显示箭头指示器未显示的微调器:

由于使用了RecyclerView,因为没有发生简单的ListView。

Bug happening

我想成为:

Fixed bug

这是SwipeRefreshLayout XML:

success

我真的希望你能帮助我。谢谢!

1 个答案:

答案 0 :(得分:0)

swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimaryDark,R.color.colorPrimaryDark,R.color.colorPrimaryDark,R.color.colorPrimaryDark,R.color.colorPrimaryDark);

    <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipe_refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="5dp"
                android:scrollbars="vertical" />

        </android.support.v4.widget.SwipeRefreshLayout>

然后转到res / values检查颜色主题...

   <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/black</item>
    <item name="android:textColor">@color/black</item>
    <item name="android:textColorSecondary">@color/colorPrimary</item>
    <item name="windowActionBar">false</item>
    <item name="windowActionBarOverlay">true</item> 
   </style>