android - 如何填充两个布局之间的剩余空间

标签 android android-layout android-relativelayout

我有一个关于 android 布局的问题。

在我的 xml 文件中,我有两个相对布局。一个通过 android:layout_alignParentTop="true"附加到顶部。

另外一个通过android:layout_alignParentBottom="true"贴在底部。

现在这两个 View 之间有很多空间。我想要两个用 FrameLayout 填充剩余的空间,其中应该显示几个不同的 fragment 。

有人知道如何填充我描述的空间吗?

非常感谢!

最佳答案

<FrameLayout android:layout_below="@+id/toplayout" 
   android:layout_above="@+id/bottomlayout"/>

关于android - 如何填充两个布局之间的剩余空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9700886/

相关文章:

安卓按钮默认背景

android - 将 ImageView 对齐,使 TextView 居中,复选框在 android xml 中最右边

android - 以编程方式设置相对布局中 EditText 和 TextView 的位置

android - 如何为 android :layout_marginLeft based LiveData<Boolean> in Android Studio? 绑定(bind)不同的值

android - TFS 本地 Xamarin 找不到 AndroidSDK

Android Intent 的节电模式( Lollipop )

android - coordinatorlayout 中的重叠 View

android - com.diffplug.gradle.spotless && 任务清理(类型 : Delete){} Error:Cannot add task 'clean' as a task with that name already exists

android - 使按钮占线性布局的 25%

java - Android:相对布局