相关疑难解决方法(0)

在Android中的表格布局中设置相等的列宽

可能重复:
XML表格布局?两个EQUAL宽度的行填充相同宽度的按钮?

TableLayout用来显示4列数据列表.

问题描述:

我无法设置所有4列的相等宽度,这是我的TableLayout.我正在使用我正在使用的布局代码...

<TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0">
        <TableRow>
            <TextView android:text="table header1" android:layout_width="wrap_content" android:layout_height="wrap_content" 
                 android:textSize="10dip" android:textStyle="bold"/>    
            <TextView android:text="table header2" android:layout_width="wrap_content" android:layout_height="wrap_content" 
                android:textSize="10dip" android:textStyle="bold"/> 
            <TextView android:text="table header3" android:layout_width="wrap_content" android:layout_height="wrap_content" 
                android:textSize="10dip" android:textStyle="bold"/> 
            <TextView android:text="table header4" android:layout_width="wrap_content" android:layout_height="wrap_content" 
                android:textSize="10dip" android:textStyle="bold"/>         
        </TableRow>
    </TableLayout>
Run Code Online (Sandbox Code Playgroud)

我应该如何重写此布局以显示相同大小的4列?

android tablelayout

70
推荐指数
2
解决办法
12万
查看次数

标签 统计

android ×1

tablelayout ×1