2016-09-06 3 views
0

2つのリサイクルビューが縦に配置されています。私はそれらを1つとしてスクロールしたいが、何が起こるかはa)2番目のrecyclerViewは隠されている。b)NestedScrollViewの高さをmatch_parentに変更すると、両方が見えるが、2番目のスクロールは以下のRecyclerViews NestedScrollView内でのスクロール

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scroll" 
    android:fillViewport="true" android:orientation="vertical" 
    android:layout_width="match_parent" android:layout_height="match_parent"> 

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

    <TextView android:id="@+id/loading" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" /> 

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

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

</LinearLayout> 

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

おかげ

答えて

0

あなたはリサイクルビューを設定しているところでこれを試してみてください

// In case you have not provided 
final LinearLayoutManager lm = new LinearLayoutManager(getActivity()); 
     recyclerView.setHasFixedSize(true); 
     recyclerView.setLayoutManager(lm); 

// for scrolling 
recyclerView1.setNestedScrollingEnabled(false); 
recyclerView2.setNestedScrollingEnabled(false); 
関連する問題