RecyclerView within NestedScrollView Scrolling Issue
--
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
I hope this article is helpful. If you think something is missing, have questions, or would like to give feedback, go ahead and leave a comment below. I’d appreciate the feedback.
I’ve written some other Android-related content, and if you liked what you read here, you’ll probably also enjoy this:
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.