私はScrollView内のRecyclerViewで23.2の問題を修正した最新のサポートデザイン(compile 'com.android.support:design:+'
)を使用しています。 RecyclerViewとExpandableListViewの両方のスクロールは完全に機能します。 ExpandableListViewが長すぎて、レイアウトを上にスクロールして残りの部分を見ることができるようにしたい場合、scrollviewは機能しません。ScrollView内のRecyclerView - ScrollViewが機能しません
フラグメント:
myRecyclerView = (RecyclerView) view.findViewById(R.id.myRecyclerView);
myRecyclerView.setNestedScrollingEnabled(false);
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);
layoutManager.setAutoMeasureEnabled(true);
myRecyclerView.setLayoutManager(layoutManager);
MyListAdapter myListAdapter = new MyListAdapter(recyclerDataList, getActivity());
myRecyclerView.setAdapter(myListAdapter);
のxml:
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:id="@+id/headerText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="header text"
android:layout_marginRight="10dp"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/myRecyclerView"
android:layout_below="@id/headerText"
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<ExpandableListView
android:id="@+id/expandableList"
android:layout_below="@id/myRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="1dp"
android:dividerHeight="0dp"
android:groupIndicator="@null"
android:listSelector="@android:color/transparent"
android:showDividers="middle" >
</ExpandableListView>
</RelativeLayout>
</ScrollView>
これは重複していません。私のrecyclerviewはうまく動作し、問題はscrollview thaはrecyclerviewをthostsです。 – BVtp