Skip to content Skip to sidebar Skip to footer

How To Disable Recyclerview Scrolling To Make The Layout Listen Its Scrollview Parent?

I'm trying to put a RecyclerView, inside a ScrollView. But the ScrollView doesn't scrolls and the RecyclerView does but I don't want it to... What can I do? I tried with this class

Solution 1:

You could easily achieve it by changing your scroll view into a NestedScrollView and setting recyclerView.setNestedScrollingEnabled(false) Has the highest performance and No need to override the layout manager.

Solution 2:

I think you just need to wrap recyclerView so that other views can be visible. Just use this library so that you can adjust recycler view height coz linearLayoutManager as per now matches height to match parent. https://github.com/serso/android-linear-layout-manager

Solution 3:

it not as simple as you think. when you use tow scrollble element inside each other you are in hot water! you should calculate the Recycler item height and then find the whole recycler height. look at below link, I explain completely this problem.

Use RecyclerView indie ScrollView with flexible recycler item height

I hope it help you

Post a Comment for "How To Disable Recyclerview Scrolling To Make The Layout Listen Its Scrollview Parent?"