Android 水平滚动视图中的表格布局

Android 水平滚动视图中的表格布局,android,view,tablelayout,Android,View,Tablelayout,我正在使用以下代码创建一个可水平滚动的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_heigh

我正在使用以下代码创建一个可水平滚动的
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
中的列至少填充屏幕(即,如果只有一列,则该列的边框应延伸至整个屏幕,如果有两列,则两列的边框应填充屏幕等)


我该怎么做呢?

显示三列大小相等的列

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout
    android:layout_weight="1"
    android:layout_width="fill_parent"                  
    android:layout_height="fill_parent"
    android:background ="#dddddd"
    />
<TableLayout
    android:layout_weight="1"
    android:layout_width="fill_parent"                  
    android:layout_height="fill_parent"
    android:background="#ffffff"
    />
<TableLayout
    android:layout_weight="1"
    android:layout_width="fill_parent"                  
    android:layout_height="fill_parent"
    android:background ="#dddddd"
    />


我也有同样的问题。我通过将
android:fillViewport=“true”
添加到
HorizontalScrollView

解决了这个问题,而
android:stretchColumns=“*”
应该可以做到这一点。有什么问题吗?本杰明,你的答案有严重缺陷。它不仅不使用HorizontalScrollView,而且还使用三个单独的表布局,每个表布局用作列。这没有道理。应该有一个TableLayout,其中TableRow包含视图作为列的内容。