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。