如何在TableLayout三列 [英] how to create three columns in TableLayout

查看:154
本文介绍了如何在TableLayout三列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发使用 TableLayout 的屏幕。在这里,我很容易能够创建两列。但我怎么可以创建三个列?

I am developing a screen that uses TableLayout. Here I am easily able to create two columns. but how can I create three columns ?

推荐答案

下面的例子:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1">
    <TableRow>
        <TextView
            android:text="first"
            android:padding="3dip" />
        <TextView
            android:text="second"
            android:gravity="center"
            android:padding="3dip" />
        <TextView
            android:text="third"
            android:gravity="right"
            android:padding="3dip" />
    </TableRow>

    <TableRow>
        <TextView
            android:text="first"
            android:padding="3dip" />
        <TextView
            android:text="second"
            android:gravity="center"
            android:padding="3dip" />
        <TextView
            android:text="third"
            android:gravity="right"
            android:padding="3dip" />
    </TableRow>
</TableLayout>

这篇关于如何在TableLayout三列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆