次のようなレイアウトを作成したい:
TableLayout
アクティビティ レイアウトに次のものがあります。
<TableLayout
android:id="@+id/table"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1" >
</TableLayout>
TableRow
次に、このレイアウトでa を膨らませます。
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tablerow"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_weight="1"
android:text="name" />
<TextView
android:id="@+id/value"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="1"
android:text="value" />
</TableRow>
そして、それをに追加しTableLayout
ます。stretchColumns
0 または 1 に設定しようとしましたが、別のlayout_width
値を使用しましたが、役に立ちませんでした。すべての最初の列をすべて、TableRows
最も広い TextView と同じくらい広くする必要があります。