我使用TableLayout到當前位置的一些按鈕span元素,我想跨越按鈕2跨2行,所以這將是下一個按鈕1,3。 的Android TableLayout - 跨兩行
我知道它可以用網格/相對佈局來完成,但我需要使它與表格佈局一起工作。
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 2" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 3" />
</TableRow>
</TableLayout>
你有這個解決方案嗎? – 2016-01-05 07:44:55
你不能直接使用TableLayout來做,你可以取一行並給它兩倍的權重,比插入另一個佈局給你你想要的。 – aviran