【发布时间】:2012-08-03 11:58:56
【问题描述】:
我正在尝试在 Android 中使用垂直和水平滚动制作两列 <TableLayout>。
像这样:
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:weightSum="1.0" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height=".90"
android:layout_gravity="left"
android:layout_weight=".35" >
<TextView
android:id="@+id/TextView04"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#b0b0b0"
android:text="column 1"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:layout_weight=".65" >
<TextView
android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#a09f9f"
android:text="column 2"
android:textColor="#000000" />
</LinearLayout>
</TableRow>
</TableLayout>
也许有人可以帮助我编写所有代码?
【问题讨论】:
-
抱歉,这不是“请提供 codez”网站...
标签: android xml android-layout android-tablelayout