嵌套滚动视图中的滚动视图无法正常工作

3

这是真的吗?我想在我的活动中使用嵌套滚动视图,也能够滚动列表视图。请帮忙。谢谢。

<android.support.v4.widget.NestedScrollView
    android:id="@+id/login_form"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/insertkend_form"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

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

            <ListView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/listAksesoris">
            </ListView>

        </ScrollView>

   </LinearLayout>

</android.support.v4.widget.NestedScrollView>


这个布局很奇怪 - 你有三层滚动视图(NestedScrollView、ScrollView和ListView)。最重要的问题是,你为什么需要它们全部? - Doron Yakovlev Golani
首先我在NestedScrollView中构建了一个表单,在ListView中需要使用复选框来检查一些选项。希望你明白我的意思。@DoronYakovlev-Golani - Sugi Almantara
1个回答

7
现在它可以工作了,只需删除scrollview并在listview中添加android:nestedScrollingEnabled="true"即可。

它在移动另一个片段后停止,然后停止滚动列表视图。 - Md. Ashikur Rahman

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接