开发者

Android ListView set Number of items to show

开发者 https://www.devze.com 2022-12-22 08:39 出处:网络
How can i set the number of items to show in a list without to scroll? Example: I have a list with开发者_C百科 10 items.

How can i set the number of items to show in a list without to scroll?

Example: I have a list with开发者_C百科 10 items. I want that only 3 items appears and that I have to scroll to see the rest of the items.


I think the amount of Items shown in the Listview depends on the size that is available for the list. I would try a layout that limits the size of the list. It could be possible that such a detailed layout is not possible very easily, a different screen size could show more items etc.


just do:

list.remove(3);
list.remove(4);
...
list.remove(9);

in the constructor of the listview adapter.

0

精彩评论

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

关注公众号