I have the following layout for a dialog:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/categorylist"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0">
<TableRow>
<ListView
android:id="@+id/categorylistview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:scrollbars="vertical"
android:scrollbarStyle="insideOverlay"
/>
</TableRow>
<TableRow>
<TextView
android:text="New Category"
...
</TextView>
</TableRow>
<TableRow>
<EditText
android:id="@+id/NewCategoryEditText"
...
</EditText>
</TableRow>
<TableRow>
<Button
android:id="@+id/newcategorybutton"
...
/>
</TableRow>
</TableLayout>
I would like the Listview to grow until the available space is used, then scroll as it coninues to grow. This works fine when the table row with the Listview is the last one in the TableLayout:
However, having the Add button at the top of the list is not very intuitive. When I move the "fixed" table rows to the bottom, the ListView will push them off the screen once it grows to a point where it should scroll. The ListView will only then begin to scroll when there is nothing else left that can be pushed off the screen:
How can I change my layout so that the table rows with the button and the EditText view remain visible?