設置表寬度和列數在TableLayout是否有任何方法,使表像Android的HTML,我可以設置行列寬度正如我們在HTML如何在Android的
<table >
<tr><td style="width:'50%;"></td>
<td style="width:'50%;"></td>
</tr>
</table>
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="3" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
做
編輯1:
對於一些像HTML存在的百分比寬度工程關於其父
但Android中引入的權重與可用於 根的屏幕大小有關。
列號是從零開始的,所以stretchColumns應該是2 – user648026 2014-02-25 04:03:44