【发布时间】:2011-11-11 17:31:10
【问题描述】:
我正在使用以下代码创建一个可水平滚动的TableLayout:
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="200dp"
android:scrollbars="none">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/maintable2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
android:background ="#dddddd"
android:scrollbars="none" >
</TableLayout>
</HorizontalScrollView>
我需要TableLayout 中的列至少填满屏幕(即,如果只有一列,则该列的边框应延伸到整个屏幕,如果有两列,则两列的边框应该填满屏幕等)。
我该怎么做?
【问题讨论】:
-
好吧
android:stretchColumns="*"应该这样做。有什么问题?
标签: android view tablelayout