0

下部に 2 つのボタンが並んでいるアプリケーションがあります (RelativeLayout 内の TableLayout 内)。これは小さな画面では問題ないように見えますが、大きな画面では下部に醜い黒いスペースが残ります。ボタンを縦に広げてスペースを埋めたいのですが、方法がわかりません。

以下のコードを含めました (簡単にするために RelativeLayout の内容を削除しています。以下は、それを含むバージョンとまったく同じように動作します)。

<RelativeLayout android:id="@+id/RelativeLayout01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android">

    <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <TableRow android:layout_width="fill_parent" android:layout_height="fill_parent">
            <Button android:layout_width="wrap_content" android:id="@+id/Button01" android:text="@string/Button01" android:layout_weight="50" android:layout_height="fill_parent"></Button>
            <Button android:layout_width="wrap_content" android:id="@+id/Button02" android:text="@string/Button02" android:layout_weight="50" android:layout_height="fill_parent"></Button>
        </TableRow>
    </TableLayout>

</RelativeLayout>

現在のレイアウトでボタンを伸ばす方法、またはこれをより簡単に行うことができる別のレイアウトを知っている人はいますか?

ありがとう、

4

2 に答える 2

0

もう少し (たくさん) 実験を重ねた結果、私がこれに間違った方法で取り組んでいたことが判明しました。TableLayout を削除して LinearLayout に置き換えると、高さの fill_parent 属性が期待どおりに機能し始め、すべて問題ありません。

于 2011-02-07T23:52:32.547 に答える
0

android:layout_alignParentBottom='true'相対レイアウト内では、プロパティを使用して、ボタンの下端をレイアウトの下端に揃えることはできませんか? 下マージンを適用して、ギャップを残すことができます。

于 2011-02-07T20:25:11.157 に答える