我試圖創建一個佈局,其中包含一個2x2的按鈕網格(共4個)。我得到了以下內容,但它只在左上角創建按鈕網格。我想讓按鈕網格填滿整個屏幕。2x2按鈕網格佈局
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</TableRow>
我是如此接近回答這個問題過於:( –
感謝那乾淨 –