有人告诉我,我可以使用第二个线性布局,使得我的按钮可以拉伸以垂直填充剩余的空白空间。我不确定该从哪里出发。任何帮助,将不胜感激。按钮填充垂直空间
<?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:gravity="center"
android:orientation="vertical" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="horizontal" >
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center">
<TableRow>
<Button
android:id="@+id/one"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="fill_vertical"
android:layout_weight="1"
android:gravity="center"
android:text="1" />
<Button
android:id="@+id/two"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="2" />
</TableRow>
<TableRow>
<Button
android:id="@+id/three"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="fill_vertical"
android:layout_weight="1"
android:gravity="center"
android:text="3" />
<Button
android:id="@+id/four"
android:text="4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1" />
</TableRow>
<TableRow>
<Button
android:id="@+id/five"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:text="5" />
<Button
android:id="@+id/six"
android:text="6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1" />
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
它应该是一个答案,而不是评论。 – Androiderson
Hello先生,您好,我现在没有50位代表发表评论他的问题来阐述他的问题。你所做的是什么。没有?在它上面你的-ve投票也没有帮助事业。谢谢! – Manu
嗨马努,不幸的是,这个网站的规则指出,在这种情况下你应该什么也不做。 – Androiderson