android开发分享用TableLayout生成列


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

它在TableLayout的文档中说“单元格可以跨越列,就像在HTML中一样”。 但是,我找不到这样做的方法。

具体来说,我有一列两列,另一列有一列。 我想要一列的行跨越整个表。 看起来很简单,但是我看不到它。

    添加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> 

    android:layout_span做的伎俩。

    例:

    以上就是android开发分享用TableLayout生成列相关内容,想了解更多android开发(异常处理)及android游戏开发关注计算机技术网(www.ctvol.com)!)。

     <TableLayout xmlns:android="https://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow> <TextView android:id="@+id/info" android:layout_span="2" android:text="some text" android:padding="3dip" android:layout_gravity="center_horizontal" /> </TableRow> <TableRow> <TextView android:text="some other text" android:padding="3dip" /> <TextView android:text="more text" android:padding="3dip" /> </TableRow> </TableLayout> 

      本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

      ctvol管理联系方式QQ:251552304

      本文章地址:https://www.ctvol.com/addevelopment/512713.html

      (0)
      上一篇 2020年11月27日
      下一篇 2020年11月27日

      精彩推荐