raklos
raklos

Reputation: 28555

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

Upvotes: 11

Views: 2961

Answers (1)

raklos
raklos

Reputation: 28555

This worked for me:

mRecyclerView.setFocusable(false);

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

Upvotes: 18

Related Questions