RecyclerView within NestedScrollView Scrolling Issue

Danish Amjad
AndroidPub
Published in
2 min readMay 30, 2018

--

Image Source:

As we already know that recyclerView has a smooth scrolling by itself but when we need to put recyclerView within any scrollView it will not work like the below code snippet:

Solution:

The solution for this is we need to use nestedScrollView instead of scrollview like the below code snippet:

Now what kinda problem occurred when we used nestedScrollView and put recyclerView inside nestedScrollView, it scrolls at various speeds depending on gestures. The scrolling feature will not be smooth.

So to fix this issue all you have to do after setting your adapter

put this line ViewCompat.setNestedScrollingEnabled(recyclerView, false);

Now your recyclerview will work with smooth scrolling…

Visit my Website at https://danishamjad.com

Sharing the knowledge is Caring :-)

Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.

If you need any help then Join me on Twitter, Linkedin, Github, and Subscribe to my Youtube Channel.

--

--

Danish Amjad
AndroidPub

Senior Mobile Engineer (Android). Open Source Contributor, Technical Writer, Email: Dani.amjad12@gmail.com check my website at https://danishamjad.com/