开发者

Can I use more than one list view in resource layout file?

开发者 https://www.devze.com 2023-02-17 03:30 出处:网络
Can I use more than one ListView in a layout, because my list adapter is considering the ListView with id \"list\", how to set the adapters开发者_开发问答 for the remaining list views?You can\'t do it

Can I use more than one ListView in a layout, because my list adapter is considering the ListView with id "list", how to set the adapters开发者_开发问答 for the remaining list views?


You can't do it with a ListActivity. You can do it with your own Activity subclass, but you have to be a little careful about defining the heights for vertically stacked ListViews. One way to do it is to put them in a LinearLayout, set the layout_height of each to 0px, and set the layout_weight of them to non-zero numbers in proportion to how much space you want each to take up. (For equal-height lists, for example, set the layout_weight of each to 1.)

0

精彩评论

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