raklos raklos - 1 month ago 26
Android Question

recyclerview inside scroll view affects scroll position

I have the following layout structure

--FrameLayout
--scrollview
--LinearLayout
--LinearLayout
--RecyclerView
--LinearLayout


When I arrive at the page, it seems to scroll to the recycler view.
I just want scroll position to be at the top when arriving at the page.

Seems odd, When i switch the order between the linearlayoout and recyclerview inside the scrollview, then the behaviour is correct - as in the scroll position is at the top

Answer

This worked for me:

mRecyclerView.setFocusable(false);

Although a lot of good answers here: How to scroll to top of long ScrollView layout?

Comments