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

2020-07-24  本文已影响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);

上一篇下一篇

猜你喜欢

热点阅读