0
点赞
收藏
分享

微信扫一扫

页面切换时为什么会自动跳到recyclerView的位置?

原因:

页面切换时RecyclerView获得了焦点,RecyclerView的 focusableOnTouchMode属性默认是true,所以页面切换时RecyclerView自动获得焦点就滚动到头部。抢焦点的问题。


解决:

将RecyclerView的父控件的设置android:focusableInTouchMode="true" 。

不行就再加上android:focusable="true"


​​https://code.google.com/p/android/issues/detail?id=81854#c11​​




举报

相关推荐

0 条评论