SwiperRefreshLayout箭头指示器未显示

3

我有一个问题,第一次向下滑动以显示Spinner时,箭头指示器没有显示:

这是由于RecyclerView引起的,因为使用简单的ListView不会发生这种情况。

Bug happening

我想要成为什么样子:

Fixed bug

这是SwipeRefreshLayout的XML:

<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeRefreshLayout_pitchList"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView_pitchList"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>

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

1个回答

0

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

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>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接