У меня есть следующий XML для макета на Android
<?xml version="1.0" encoding="utf-8" ?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Select building row -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
style="@style/Default"
android:layout_width="200px"
android:text="Gebouw:"/>
<Spinner
android:id="@+id/buildingSpinner"
style="@style/Default"
android:layout_width="300px"/>
</TableRow>
<!-- Select section row -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
style="@style/Default"
android:layout_width="200px"
android:text="Verdieping:"/>
<Spinner
android:id="@+id/SectionSpinner"
style="@style/Default"
android:layout_width="300px"/>
</TableRow>
<!-- Select room row -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="300px"
android:layout_margin="4px"
android:layout_span="2"
android:background="#BBBBBB">
<ListView
android:id="@+id/roomsList"
style="@style/Default"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="2px"
android:background="#EEEEEE"/>
</LinearLayout>
</TableRow>
<!-- Buttons row -->
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/selectedRoomText"
style="@style/Default"
android:layout_width="fill_parent"
android:text=""/>
<Button
android:id="@+id/btnCreateChecklistForRoom"
style="@style/Default"
android:text="OK"/>
</TableRow>
</TableLayout>
Я пытаюсь, чтобы TableView и ListView занимали всю ширину экрана, но я не могупохоже, он работает.
Тем не менее, я также хотел бы, чтобы ListView занял все оставшееся вертикальное пространство после визуализации других элементов.
Есть предложения?