设置表宽度和列数在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