我想將兩個回收站視圖添加到一個佈局中,該佈局位於Fragment
。但我能看到的是第一個RecyclerView
。 是否有可能像上圖中那樣添加兩個回收站視圖(兩者都需要同時可見),還是在Android中存在某種限制,只有一個回收站視圖可以添加到一個完整屏幕?同時在一個片段中同時顯示多個回收站視圖
<?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>
顯示您的XML。這可以通過LinearLayout和權重來完成。 – yennsarah
添加了版面 – user3477811