Dav*_*ave 2 android tablelayout
我如何使用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>
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,将视图替换为您想要的视图...
| 归档时间: |
|
| 查看次数: |
4248 次 |
| 最近记录: |