android: RecyclerView inside a ScrollView

nomongo picture nomongo · Aug 27, 2014 · Viewed 21.9k times · Source

I have a RecyclerView wrapped in a LinearLayout and it works perfectly as expected. I can see all the data in the RecyclerView as populated. So far so good.

When I wrap the LinearLayout in a ScrollView, the RecyclerView goes blank. I do not see anything inside RecyclerView. Why? How to make this work.

The page is one of the tabs in a ViewPagerIndicator, so everything in that tab needs to be in a ScrollView.

Thanks for all the help.

Answer

Sathesh picture Sathesh · Jan 28, 2015

Set this property for the ScrollView,

 android:fillViewport="true"

ScrollView will extend itself to fill the contents