Ich habe ein XML-Layout mit folgenden Ansichten Scrollview-> RelativeLayout-> Einige Ansichten + Tablayout + ViewPager-> Recylerview (In Fragment von ViewPager). ViewPager hat eine feste Höhe (Keeping it "Wrap_Content" zeigt es überhaupt nicht). Nun ist das Problem, dass Recylerview nie scrollt. Ich habe mehrere Lösungen bereits gepostet wie Wrapping Viewpager innerhalb "verschachtelte Scrollview" Oder sogar Kind von LinearLayout. Aber nichts hat funktioniert.Recyclerview innerhalb ViewPager innerhalb scrollview funktioniert nicht
Unten ist mein xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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"
android:layout_above="@+id/btn_startdraw"
android:fillViewport="true"
android:gravity="center">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="@dimen/_5sdp">
<TextView
android:id="@+id/invites_accepted"
style="@style/bodyStyleBlue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/committee_slots"
android:text="@string/invites_accepted" />
<!-- A lot of other Textfields for data display-->
<android.support.design.widget.TabLayout
android:id="@+id/tabs_pendingcommittee"
style="@style/TabStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/draw_mode_val"
app:tabMode="fixed"></android.support.design.widget.TabLayout>b
<com.apponative.committeeapp.ui.custom.CustomViewPager
android:id="@+id/pending_member_view"
android:layout_width="match_parent"
android:layout_height="@dimen/_250sdp"
android:layout_below="@+id/tabs_pendingcommittee"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<!-- Some other views on bottom-->
</RelativeLayout>
Und Fragment dass Viewpager zeigt xml hat folgenden Aufbau:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<TextView
style="@style/bodyStyleBold1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="No People..." />
<android.support.v7.widget.RecyclerView
android:id="@+id/contact_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:background="@color/white"></android.support.v7.widget.RecyclerView>
</FrameLayout>
ich versucht habe, mit nestedScrollingEnabled und auch setFixedHeight Eigenschaften auf Recyclerview. Aber nichts hat funktioniert.
Ich denke, Sie sollten scroll Ansicht von Relative Layout als Recycler Ansicht selbst hat seine eigenen scroller entfernen. –
@RounakLahoti Mein Layout hat viele Ansichten, die gescrollt werden müssen. Ich verwende keine srollview für diese RecyclerView. Recylerview ist auch ein Kind im Layout, das neben anderen Ansichten eine andere Liste von Daten anzeigt (eine Kombination aus TextView, ImageView, EditView). –