0

我有从服务器获取的 XML,并且有这样的 HTML 表:

<table>
    <tr>
        <td colspan="4">$kolumn1$</td>
    </tr>
    <tr>
        <td colspan="2">$kolumn2$</td>
        <td>$kolumn3$</td>
        <td>$kolumn4$</td>
    </tr>
    <tr>
        <td>$kolumn5$</td>
        <td colspan="3">$kolumn1$</td>
    </tr>
</table>

现在,我想像这样创建 Android TableLayout:

<TableRow
    android:layout_width="fill_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_span="4" />
</TableRow>

<TableRow
    android:layout_width="fill_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_span="2" />

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />
</TableRow>

<TableRow
    android:layout_width="fill_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_span="3" />
</TableRow>

从 HTML 代码创建 TableLayout 的最佳方法是什么?

4

1 回答 1

0

尝试这个:

 I have to like create Relative layout inside the TableRow
 And put the components to Relative layout
 It's worked me. I hope this will be worked for you also..
于 2013-02-06T13:18:07.277 回答