当前位置: 首页 > 工具软件 > Auto Scroll > 使用案例 >

Android list view inside a scroll view auto scroll issue,在ScrollView中嵌套ListView,当ListView数据多时,避免自动跳

汤乐家
2023-12-01

http://stackoverflow.com/questions/28913115/android-list-view-inside-a-scroll-view-auto-scroll-issue



Add android:descendantFocusability="blocksDescendants" to child of SrollView (and parent of ListView)


<ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:descendantFocusability="blocksDescendants">

这样子就可以了。

 类似资料: