【问题标题】:Making the vertical scrollbar visible and horizontal scroll bar visible使垂直滚动条可见,水平滚动条可见
【发布时间】:2023-03-17 03:24:02
【问题描述】:

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

【问题讨论】:

    标签: android scroll android-tablelayout


    【解决方案1】:

    尝试用这种方式创建布局,

    <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>
    

    【讨论】:

      猜你喜欢
      • 2011-11-30
      • 2014-09-21
      • 2022-06-21
      • 1970-01-01
      • 1970-01-01
      • 2011-06-05
      • 1970-01-01
      • 2013-12-18
      • 2011-02-10
      相关资源
      最近更新 更多