Android 使垂直滚动条可见和水平滚动条可见

Android 使垂直滚动条可见和水平滚动条可见,android,scroll,android-tablelayout,Android,Scroll,Android Tablelayout,我正在开发一个android应用程序,其中我需要3个表格布局,第一个和最后一个应该在水平方向滚动,中间一个应该在两个方向滚动,我需要动态地向这些表格布局添加行 尝试以这种方式创建布局 <ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:layout_width="

我正在开发一个android应用程序,其中我需要3个表格布局,第一个和最后一个应该在水平方向滚动,中间一个应该在两个方向滚动,我需要动态地向这些表格布局添加行

尝试以这种方式创建布局


<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TableLayout
            android:id="@+id/table_layout1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
        </TableLayout>

        <HorizontalScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <TableLayout
                android:id="@+id/table_layout2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
            </TableLayout>
        </HorizontalScrollView>

        <TableLayout
            android:id="@+id/table_layout3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
        </TableLayout>
    </LinearLayout>
</ScrollView>