1

ダイアログの次のレイアウトがあります。

<?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>      

使用可能なスペースが使用されるまでリストビューを拡大し、拡大し続けるとスクロールしたいと思います。Listview を含むテーブル行が TableLayout の最後の行である場合、これは正常に機能します。

代替テキスト
(出典: heeroz.com )

ただし、リストの上部に [追加] ボタンを配置するのはあまり直感的ではありません。「固定された」テーブルの行を一番下に移動すると、スクロールする必要があるポイントまで拡大すると、ListView はそれらを画面から押し出します。ListView は、画面から押し出すことができるものが他に何も残っていない場合にのみスクロールを開始します。

代替テキスト
(出典: heeroz.com )

ボタンのあるテーブル行と EditText ビューが表示されたままになるようにレイアウトを変更するにはどうすればよいですか?

4

1 に答える 1

4

withのTableLayout代わりに aを使用している特定の理由はありますか? を使用する場合は、で指定でき、必要な結果が得られるはずです。LinearLayoutandroid:orientation="vertical"LinearLayoutandroid:layout_weight="1"ListView

于 2010-07-03T04:05:50.853 に答える