I am trying to put multiple lists that don't need to be scrollable inside a ScrollView
. In other words, I have a TextView
as a header for a category, with a list under it. Then another TextView
as another header, with another list under that. And so on. This is in a vertical LinearLayout
.
I want to be able to scroll through this layout as it gets off the screen when it has too much info, but I want all the contents of the lists to be displayed.
I've tried putting the headers (the TextViews
) and the lists inside a vertical LinearLayout
, and that LinearLayout
inside a ScrollView
. The problem with that approach is - all the lists have a max vertical dimension of exactly one element (if I set them to "wrap content"), despite the lists having multiple elements. Believe it or not, the lists do scroll (and they're inside of a ScrollView
, more exactly, inside of a ScrollView
-> LinearLayout
).
If I remove the ScrollView
, then the lists do indeed appear with all their elements, but I can't scroll the view if it goes off the screen.
So, if I use a ScrollView
, I only get one element per each list. If I don't use it, I get all the elements of the lists correctly, but it doesn't scroll.
Any ideas of solving this? Thanks!