📃RecyclerView SmoothScrollToPosition Not Working within NestedScrollView Solution— Android.✔

Scroll your recycler view within a Nested scroll view easily

Danish Amjad
AndroidPub

--

This Story belongs to what I have learned today. As you can see from the article title that recyclerView smoothScrollToPosition() not working within NestedScrollView, now how the layout file looks like and what I mean to say that all the confusion will be clear so you can see the XML file from the below Snippet.

Visit my website at https://danishamjad.com/

I had a case that I have a screen with a top static section and then I have a recycler view in which I need to show the comments list. And I need to scroll the whole screen that’s why I used NestedScrollView.

When the user sends a comment it will be displayed on the top of the List means on 0 positions, so in my case, I need to scroll the List to 0 positions whenever user comments.

The screen which I used is like the below image.

--

--

Responses (2)