У меня есть три строки, и я хочу, чтобы размер этих строк был одинаковым, и он будет основан на размере экрана, который мы даем этой таблице в целом, что означает, что он разделит три строки поровну по заданной высотето же самое делается для столбца с помощью android:stretchColumns="0,1"
.Структура таблицы прилагается ниже:
<TableLayout android:layout_width="fill_parent" android:id="@+id/tabelViewButtons"
android:layout_marginTop="10dip" android:layout_height="fill_parent"
android:layout_below="@id/searchbar" android:layout_above="@id/follow_notification_bar"
android:fitsSystemWindows="true" android:stretchColumns="0,1"
>
<TableRow >
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_one"></ImageButton>
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_two"></ImageButton>
</TableRow>
<TableRow >
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_three"></ImageButton>
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_four"></ImageButton>
</TableRow>
<TableRow >
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_five"></ImageButton>
<ImageButton android:layout_height="fill_parent"
android:layout_width="fill_parent" android:padding="5dip"
android:id="@+id/button_six"></ImageButton>
</TableRow>
>
</TableLayout>