How to limit list items display in ListView
I am getting XML data from url and displaying using a custom list adapter in a ListView
.
I need to display only 10 items in ListView
.
How i can do this?开发者_如何学Go
Please let me know
Thanks
Only put 10 items in the adapter. Or override getCount()
and return 10
.
The adapter you're using with the ListView only displays the item you put in it. Just put in your adapter 10 items, or whatever other number you want, and it will display only that items.
精彩评论