解决scrollview嵌入ListView或GridView首次无法显示到顶部的问题

来源:互联网 发布:蜀山传月金轮淘宝 编辑:程序博客网 时间:2024/06/08 10:16
使用scrollview发现首次显示的不是顶部的内容,从网上查找解决办法有说smoothScrollTo,或者在父元素加android:focusableInTouchMode="true"
android:focusable="true",亲测了一下都不可用,最后只有一种,即将scrollview中嵌套的ListView或GridView都setFocusable(false);这种办法能解决这个问题。
0 0