繁体   English   中英

Android-带ScrollView的TableView(不是TableRow)

[英]Android - TableView with ScrollView (not TableRow)

我有一个带有2列和动态数量的TableRows的TableLayout。 每行都由一个TextView(第一列)和ExpandableListView(第二列)表示。

我在布局XML中定义了TableLayout,但没有行。 通过Java代码(活动)以动态方式创建行。

我想在我的TableLayout上而不是在每个TableRows上做一个scrollView(这是现在发生的事情)。

当我展开所有ExpandableListViews(并且表的总大小大于活动布局)时,我在最后一个expandableListView上只有滚动条,甚至在最后一行也没有。

如何滚动表格,而不是行或ExpandableListView?

layout.xml:

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true" >

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

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

    </LinearLayout>

</ScrollView>

您不能在ScrollView使用ListView ,嵌套的ListViews和任何嵌套的可滚​​动容器也是如此。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM