У меня есть таблица, которая закрывает весь экран и содержит переменное количество строк.
Я хотел бы знать, как я могу равномерно распределить эти строки по вертикали, чтобы они занимали пространство всей таблицы.
Я пробовал layout_weight и weightSum, но он не работает.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
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="0,1,2"
android:id="@+id/maintable"
android:weightSum="3" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_weight="1" >
<TextView
android:text="text 1_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 2_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 3_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_weight="1" >
<TextView
android:text="text 1_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 2_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 3_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_weight="1" >
<TextView
android:text="text 1_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 2_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="text 3_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout>
</LinearLayout>