Recycler view inside NestedScrollView causes scroll to start in the middle

I solved such issue by setting:

<ImageView ...
android:focusableInTouchMode="true"/>

to my view above RecyclerView (which was hidden after unwanted scroll). Try to set this property to your LinearLayout above RecyclerView or to LinearLayout which is container of RecyclerView (helped me in another case).

As I see in NestedScrollView source it tries to focus the first possible child in onRequestFocusInDescendants and if only RecyclerView is focusable it wins.

Edit (thanks to Waran): and for smooth scroll don’t forget to set yourRecyclerView.setNestedScrollingEnabled(false);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)