0

basierend blättern Ich habe zwei recycleView im selben Layout und gleiche SwipeRefresher eine für normales Ergebnis und eine andere für vip es so gut funktioniert hat, aber die vip recycle über dem Ergebnis recycle kommen und das gibt mir ein verkabeltes Ergebnis.Wie recyclerview auf einem anderen

Der Bildschirm zeigt vip beim Scrollen im normalen Ergebnis.

Wie kann ich zwei Recycling mit einem Scroll-Verhalten machen?

Mein Layout wie folgt aussehen: -

<android.support.v4.widget.SwipeRefreshLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/swipeRefreshLayout" 
    > 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 
    <android.support.v7.widget.RecyclerView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/vipRecycleView"/> 
    <android.support.v7.widget.RecyclerView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/resultRecycleView" 
     > 

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

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

Das folgende Bild meiner aktuellen Statue demonstrieren.

enter image description here

+0

Es ist normal, dass die resultRecyclerView match_parent in Höhe? – Vodet

+0

@Vodet yup was das Problem darin? –

Antwort

0

Versuchen

recyclerView.setNestedScrollingEnabled (true)

Haupt xml

<android.support.v4.widget.SwipeRefreshLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<android.support.v7.widget.RecyclerView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"/> 

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

Recycler Artikel

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<android.support.v7.widget.RecyclerView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"/> 

</LinearLayout> 
+0

Wie kann es das Recycling basierend auf einem anderen festlegen? –

0

Verwenden NestedScrollView und legte beide RecyclerView ‚s drin

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

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

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

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

      </android.support.v7.widget.RecyclerView> 
     </LinearLayout> 
    </android.support.v4.widget.NestedScrollView> 
</android.support.v4.widget.SwipeRefreshLayout> 
+0

Das hat mich alle Verhaltensweisen in der recycleView verloren, zum Beispiel 'recycle.setOnScollListener (....)' –

Verwandte Themen