【发布时间】:2014-08-29 12:04:00
【问题描述】:
我想在下面拉伸pool_team 列并让其他列缩小到列宽。不过,我似乎无法正确处理。其他列将包含一个小整数,pool_team 将包含一个可以换行的长名称。
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pool_table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="1"
android:shrinkColumns="0">
<TableRow
android:id="@+id/pool_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:id="@+id/pool_number"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:textAlignment="center" />
<TextView
android:id="@+id/pool_team"
android:layout_width="0dip"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/pool_wins"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:textAlignment="center" />
<TextView
android:id="@+id/pool_loses"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:textAlignment="center" />
<TextView
android:id="@+id/pool_point_difference"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:textAlignment="center" />
<TextView
android:id="@+id/pool_place"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:textAlignment="center" />
</TableRow>
</TableLayout>
【问题讨论】:
-
你能发布一张图片,它的样子和你想要的样子吗?
标签: android tablelayout android-tablelayout