美文网首页
解决ScrollView默认位置不是最顶部问题

解决ScrollView默认位置不是最顶部问题

作者: 杰奎琳子 | 来源:发表于2020-07-24 07:11 被阅读0次

1.在父元素的属性下面添加这两行即可

android:focusableInTouchMode=”true”

android:focusable=”true”

2.让页面最上方的控件获取焦点

top_list.setFocusable(true);

top_list.setFocusableInTouchMode(true);

top_list.requestFocus();

3.让页面最下方的控件失去焦点

botton_list.setFocusable(false);

botton_list.setFocusableInTouchMode(false);

相关文章

网友评论

      本文标题:解决ScrollView默认位置不是最顶部问题

      本文链接:https://www.haomeiwen.com/subject/wlthlktx.html