与多个列表视图为Android滚动 [英] Scrolling with Multiple ListViews for Android
问题描述
我完全就这一个难住了。我有三个需要被显示在屏幕上的不同列表。这是完全可能的名单将扩大过去在屏幕底部边缘,所以我需要滚动。
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.
我用尝试了滚动型
与的LinearLayout
的孩子,并把我的列表视图
在 LinearView
,但所有的列表视图
锁与滚动一个固定的高度酒吧。使用其它类型的布局意味着没有滚动。
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?
推荐答案
我没有这样做,但我一直在想这件事,因为我可能会需要做的。我能想到的三个选项:只使用一个列表,所有列表中的内容。你可以做一个ListAdapter,做这并插入一些头。这很可能是一个很可重复使用的。
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.
这篇关于与多个列表视图为Android滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!