0
我在理解如何在xml文件中將各個層疊在一起。 我搜索了一個解決方案,但找不到滿足我需求的解決方案。將LinearLayout與LinearLayout在RelativeLayout中對齊
我在RelativeLayout中有兩個LinearLayout。第一個LinearLayout包含一個RecycleView/ScrollView,第二個LinearLayout包含一些按鈕。
我想在第一個LinearLayout上設置第二個LinearLayout,但是在RelativeLayout的底部。見下圖。
這裏是我測試的是什麼(會延長第一佈局和隱藏第二)。
<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">
<LinearLayout
android:id="@+id/first"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<LinearLayout
android:id="@+id/second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/first"
android:layout_alignParentBottom="true"
app:layout_gravity="bottom">
</LinearLayout>
</RelativeLayout>
你有什麼想法如何做到這一點?
PS。我不想使用BottomNavigationView而不是第二個LinearLayout。