views:

3410

answers:

3

I'm completely stumped on this one. I have three different lists that need to be displayed on the screen. It's completely possible that the lists will extend past the bottom edge of the screen, so I would need scrolling.

I've tried using a ScrollView with a LinearLayout child, and putting my ListViews in the LinearView, but all of the ListViews lock to a fixed height with scroll bars. Using other kinds of Layouts means no scrolling.

Does anyone have any suggestions, or will I need to programmatically add the list items to some layout and hope for the best?

A: 

without being able to see your source, i can't help much however i would like to know, are the contents of the list static or dynamic? i.e. are the list items added by custom code? adapter? defined in xml?

A: 

I haven't done this yet, but I've been thinking about it since I'll probably need to do it. I can think of three options: use only one list with the contents of all lists. You can make a ListAdapter that does that and inserts some kind of header. This could probably be something very re-usable.

The other idea is to make a list of lists. But that sounds like asking for trouble.

J. Pablo Fernández
What's the third option? Because I'm interested in that topic too and I tried to do the ListViews in a ListView approach for question http://stackoverflow.com/questions/1526831/android-scrollview-layout-problem (altough I haven't seen your answer before). Talking with the guys on #android-dev, putting ListViews in a ListView is even worse than putting them in a ScrollView. (And so were my results.) Because your post war written quite long time ago, have you tried the all in a list solution by now?
svens
A: 

Use expandable ListView. Chk my answer for a similar question here: http://stackoverflow.com/questions/1526831/android-scrollview-layout-problem/3852883#3852883

Kiran Parmar