2
我将如何使用tablelayout创建以下布局?列跨越很简单,但我还没有找到有关行跨越的明确指导。如何使用Android TableLayout创建跨越多行的此布局?
我将如何使用tablelayout创建以下布局?列跨越很简单,但我还没有找到有关行跨越的明确指导。如何使用Android TableLayout创建跨越多行的此布局?
试试这个...你可以使用layout_weight属性来达到你正在尝试做.. 下面的布局将有布局在上面的图片显示的你..
<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow>
<TableLayout android:layout_width="0dip"
android:layout_weight="2" android:layout_height="fill_parent">
<TableRow android:layout_width="0dip" android:layout_weight="2"
android:layout_height="0dip">
<View android:layout_width="0dip" android:layout_weight="1"
android:layout_margin="5dip" android:layout_height="fill_parent"
android:background="#fff"></View>
<View android:layout_width="0dip" android:layout_weight="1"
android:background="#eee" android:layout_margin="5dip"
android:layout_height="fill_parent"></View>
</TableRow>
<TableRow android:layout_width="0dip" android:layout_weight="2"
android:layout_height="0dip">
<View android:layout_width="0dip" android:layout_weight="1"
android:background="#eee" android:layout_height="fill_parent"
android:layout_margin="5dip"></View>
<View android:layout_width="0dip" android:layout_weight="1"
android:layout_margin="5dip" android:layout_height="fill_parent"
android:background="#fff"></View>
</TableRow>
</TableLayout>
<TableLayout android:layout_width="0dip"
android:layout_weight="1" android:layout_height="fill_parent">
<TableRow>
<View android:layout_width="0dip" android:layout_weight="1"
android:background="#bbb" android:layout_height="fill_parent"></View>
</TableRow>
</TableLayout>
</TableRow>
在上面的代码替换为您希望在那边的一个......的观点