我有一个应用程序中底部有两个按钮(在RelativeLayout内的TableLayout中)。这在小屏幕上看起来很好,但在较大的屏幕上底部留下了一个难看的黑色空间。我想垂直扩展按钮来填充空间,但不能解决问题!Android:垂直拉伸按钮
我已经包含下面的代码(与RelativeLayout的为简明,删除的内容;在完全相同的方式下面的行为与它的版本)
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TableRow android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:layout_width="wrap_content" android:id="@+id/Button01" android:text="@string/Button01" android:layout_weight="50" android:layout_height="fill_parent"></Button>
<Button android:layout_width="wrap_content" android:id="@+id/Button02" android:text="@string/Button02" android:layout_weight="50" android:layout_height="fill_parent"></Button>
</TableRow>
</TableLayout>
</RelativeLayout>
任何人有任何想法如何拉伸当前布局中的按钮,还是不同的布局,可以让我更轻松地做到这一点?
感谢,
感谢您的答复,但我设法遇到了LinearLayouts解决方案的解决方案。不管怎么说,还是要谢谢你! – Dan 2011-02-07 23:53:13