Android list view inside a scroll view auto scroll issue

大兔子大兔子 提交于 2019-12-12 10:44:17

问题


I have an android layout setup where I have a ScrollView with some elements and inside that I have a ListView. I am using StackOverflow's answer Android list view inside a scroll view for achieving this feature and it's working fine. My ListView is below some elements like TextView, ImageView. Problem is that when the page is presented ListView get scrolled automatically so that first item in listView is at the top (ie whole scrollview gets scrolled to present listview first item). How can I avoid this auto scrolling?


回答1:


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



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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!