Ich verwende das neueste Support-Design (compile 'com.android.support:design:+'
), die von 23.2 sollte das Problem mit RecyclerView in ScrollView behoben haben. Das RecyclerView- und das ExpandableListView-Scrolling funktionieren beide perfekt. Aber wenn die ExpandableListView zu lang ist und ich in der Lage sein, das Layout nach oben zu scrollen, so dass ich den Rest sehen konnte, funktioniert der Scrollview einfach nicht.RecyclerView innerhalb ScrollView - ScrollView funktioniert nicht
Fragment:
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>
das ist kein Duplikat. Mein Recyclerview funktioniert gut, das Problem ist die Scrollview, die die Recyclerview zeigt. – BVtp