Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recyclerview automatically scroll up (a little) when update

I have a RecyclerView in CoordinatorLayout in a fragment, there is a problem with RecyclerView in some situations, when I reload this fragment or calling notifyDataSetChanged(), RecyclerView automatically scroll up a little (about 1 cm)!!!! And because of this, scrolling on AppBarLayout doe's not work! It's on android 4.2.2. I googled it and cant find anything about this!

like image 401
majidkabir Avatar asked Nov 23 '25 22:11

majidkabir


1 Answers

Deepak Rathore answer worked for me.

Adding android:descendantFocusability="blocksDescendants" to coordiante layout fixed my problem.

like image 147
majidkabir Avatar answered Nov 25 '25 10:11

majidkabir