我决定将 2RelativeLayouts
用于我的应用程序,一个用于左侧屏幕上的Layout
一部分孩子,另一个用于右侧的孩子。Views
Views
问题是我不知道如何在 XML 中布置它们,这样当我膨胀我的Layout
.
当我使用 1RelativeLayout
时,中间的空白被 填充RelativeLayout
,我不能触摸它后面的任何东西。
非常感谢您的阅读。
我决定将 2RelativeLayouts
用于我的应用程序,一个用于左侧屏幕上的Layout
一部分孩子,另一个用于右侧的孩子。Views
Views
问题是我不知道如何在 XML 中布置它们,这样当我膨胀我的Layout
.
当我使用 1RelativeLayout
时,中间的空白被 填充RelativeLayout
,我不能触摸它后面的任何东西。
非常感谢您的阅读。
执行类似于以下示例的操作。
这将使用 2 创建一个用于LinearLayout
分隔的,然后您可以使用任何您想要的填充。RelativeLayouts
layout_weight
RelativeLayouts
RelativeLayouts
只是示例的Buttons
占位符。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST1" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST2" />
</RelativeLayout>
</LinearLayout>