I\'m trying to create a phone dialer view, using a TableLayout to create the 12 buttons in a 3x4 grid. I would like the rows to stretch vertically to use up all available space
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
>
<TableRow
android:layout_weight="1"
android:gravity="center">
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="center">
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="center">
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="center">
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
<Button android:text="Button" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</TableRow>
</TableLayout>
</LinearLayout>