Recyclerview 更新时自动向上滚动(一点点)
Recyclerview automatically scroll up (a little) when update
我在 CoordinatorLayout
中有一个 RecyclerView
在 fragment
中,在某些情况下 RecyclerView
有问题,当我重新加载这个 fragment
或者调用notifyDataSetChanged()
,RecyclerView
自动向上滚动一点(大约1厘米)!!!!因此,在 AppBarLayout
上滚动是行不通的!
它在 android 4.2.2 上。
我在谷歌上搜索了一下,找不到任何相关信息!
Deepak Rathore 答案对我有用。
添加 android:descendantFocusability="blocksDescendants"
到坐标布局解决了我的问题。
我在 CoordinatorLayout
中有一个 RecyclerView
在 fragment
中,在某些情况下 RecyclerView
有问题,当我重新加载这个 fragment
或者调用notifyDataSetChanged()
,RecyclerView
自动向上滚动一点(大约1厘米)!!!!因此,在 AppBarLayout
上滚动是行不通的!
它在 android 4.2.2 上。
我在谷歌上搜索了一下,找不到任何相关信息!
Deepak Rathore 答案对我有用。
添加 android:descendantFocusability="blocksDescendants"
到坐标布局解决了我的问题。