2016-08-27 1 views
0

同じ画面上に一覧表とグリッドで作業していないリフレッシュしスワイプは働いていないリフレッシュするために、私は同じ画面が、スワイプのリストとグリッドのリサイクルビューを使用しています

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

<android.support.v7.widget.RecyclerView 
    android:id="@+id/listView" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 

</android.support.v7.widget.RecyclerView> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recycler_view" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:visibility="gone" /> 

私は間違ったことをしているか、間違った方法で実装していますか?

+0

レイアウトのスナップショットを投稿できますか? SwipeToRefreshLayoutを複数のrecyclerviewsで使用できるかどうかはわかりません。リフレッシュするためにスワイプを実装するためのガイド:https://guides.codepath.com/android/Implementing-Pull-to-Refresh-Guide –

+0

私はあなたが正しいと思います。私は2つのスワイプを使用してリサイクルビューをリフレッシュしても問題ありません –

答えて

0

これはのみ含めることができます

<android.support.v4.widget.SwipeRefreshLayout 
     android:id="@+id/list_refresh" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
 <android.support.v7.widget.RecyclerView 
      android:id="@+id/trending_list" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:visibility="visible" /> 

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


     <android.support.v4.widget.SwipeRefreshLayout 
      android:id="@+id/grid_refresh" 
      android:visibility="gone" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

      <android.support.v7.widget.RecyclerView 
       android:id="@+id/trending_grid" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:visibility="gone" /> 

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

複数のリサイクルビューをリフレッシュするためにスワイプとして

をリフレッシュするために、同じスワイプでは動作しません。私のために働いていたものです1人の子供

関連する問題