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
NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child. In your case you have to define your own scrolling behaviour.
NestedScrollView is used when there is a need for a scrolling view inside another scrolling view.
NestedScrollView is just like ScrollView , but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.
To be able to scroll through a vertical list of items that is longer than the screen, you need to add a vertical scrollbar. Inside RecyclerView , add an android:scrollbars attribute set to vertical .
This worked for me:
mRecyclerView.setFocusable(false);
Although a lot of good answers here: How to scroll to top of long ScrollView layout?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With