ScrollView嵌套LIstView时,打开这个页面,焦点会在ListView上,因而页面不在最顶部;
解决办法:
在根layout上设置以下属性
android:focusable="true"
android:focusableInTouchMode="true"
本文解决了ScrollView嵌套ListView时,打开页面焦点不在顶部的问题。通过设置根layout的focusable和focusableInTouchMode属性为true,确保页面加载时自动滚动到顶部。
ScrollView嵌套LIstView时,打开这个页面,焦点会在ListView上,因而页面不在最顶部;
解决办法:
在根layout上设置以下属性
android:focusable="true"
android:focusableInTouchMode="true"

被折叠的 条评论
为什么被折叠?