Czy istnieje i każda metoda, aby stół jak html w android gdzie mogę ustawić szerokość kolumny wiersza, jak my w htmlJak ustawić szerokość stołu i liczba kolumn w TableLayout w Androidzie
<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>
Edit 1:
Na coś jak HTML tam pracach szerokość procent w odniesieniu do jednostki nadrzędnej
, ale waga wprowadzona w systemie Android działa w odniesieniu do rozmiaru ekranu dostępnego dla rootu .
Numery kolumn są oparte na zera, więc stretchColumns powinno być 2 – user648026