使用TableLayout跨越列

Sha*_*zon 39 android android-tablelayout

可能重复:
Android TableLayout中"colspan"的等价物是什么?

它在TableLayout的文档中说"单元格可以跨越列,就像它们可以在HTML中一样".但是,我找不到任何办法.

具体来说,我有一行有两列,另一行有一列.我希望一列行跨越整个表.看起来很简单,但我没有看到它.

Inc*_*App 69

添加android:layout_span ="3"以跨越3列.例如:

        <TableRow>
            <Button android:id="@+id/item_id"
                android:layout_span="2"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:text="item text" />     
        </TableRow>
Run Code Online (Sandbox Code Playgroud)

  • 啊,就是这样,在TableRow.LayoutParams:http://developer.android.com/reference/android/widget/TableRow.LayoutParams.html (3认同)
  • 找到那些布局XML文件很棘手 - 很容易忘记android:layout_*属性在单独的javadocs中. (2认同)

归档时间:

查看次数:

68631 次

最近记录:

13 年 前