开发者

Is there a way to define a list height as the height of all its items? (Android)

I asked this question earlier, but I didn't really understand the only response I got. I'm having some problems writing a program that adds to a list dynamically at runtime. The p开发者_Python百科rogram has some things above the list and the idea is that the user scrolls down to see the list that the program generates based on the user's input. However, when I use a list it is impossible for the user to see the lower parts of the list because the list takes up a set amount of space and if you try to scroll, the parent ScrollView takes over and assumes that you are trying to scroll the entire activity.

Is there a way to make the List height expand dynamically to wrap the children that are added so that the user can see all of the items in the list while using the Scrollview's scrolling ability? I have tried setting the height to wrap_content, but that did not work. Any help is appreciated. Thanks.


The Android engineers have stressed that ListViews should never be put in ScrollViews. This answer might be of some help to you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜