Ich versuche, zwei Recycler-Ansichten zu einem einzigen Layout hinzufügen, die in einem Fragment
ist. Aber alles, was ich sehen kann, ist die erste RecyclerView
. Ist es möglich, zwei Recycler-Ansichten wie im obigen Bild hinzuzufügen (beide müssen gleichzeitig sichtbar sein), oder gibt es eine Einschränkung in Android, dass nur eine Recycler-Ansicht zu einem vollständigen Bildschirm hinzugefügt werden kann?Mehrere Recycler-Ansicht in einem Fragment sichtbar gleichzeitig
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/test_recycle1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#FFCC00"
android:dividerHeight="4px"
android:background="#e0e0e0"/>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/test_recycle2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#FFCC00"
android:dividerHeight="4px"
android:background="#e0e0e0"/>
</LinearLayout>
</LinearLayout>
Zeigen Sie Ihre xml. Dies kann mit einem LinearLayout und Gewichten erfolgen. – yennsarah
hinzugefügt das Layout – user3477811