11

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

raklos
  • 28,027
  • 60
  • 183
  • 301
  • Post some of you code pleas, also you're ASCII drawing says that the scrollview holdes two child's, which it can't. – Eixx Jun 30 '16 at 12:08
  • my mistake, corrected – raklos Jun 30 '16 at 12:10
  • seriously not understandable.. Please use some images & code be more descriptive..!! And **RecycleView inside ScrollView is always weird** check this [1st](http://stackoverflow.com/questions/27083091/recyclerview-inside-scrollview-is-not-working), [2nd](http://stackoverflow.com/questions/32420770/use-recyclerview-inside-scrollview-with-flexible-recycler-item-height). – Janki Gadhiya Jun 30 '16 at 12:30
  • @jankigadhiya - not really. You can have horizontal recyclerview inside vertical scrollview, but if both are vertical - for sure it is bad – Mateusz Pryczkowski Jun 30 '16 at 12:52

1 Answers1

18

This worked for me:

mRecyclerView.setFocusable(false);

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

Community
  • 1
  • 1
raklos
  • 28,027
  • 60
  • 183
  • 301