How to divide and load a ListView in multiple parts?

前端 未结 3 1212
陌清茗
陌清茗 2021-01-21 10:57

I am wondering how could i divide my ListView in parts and display only one part of it when user starts my app and display others when user press a Button called \"

3条回答
  •  被撕碎了的回忆
    2021-01-21 11:22

    From your question, it seems that you want to load few items initially and then load more items in future whenever user click on the "Load More items" button.

    For that there can be two cases possible:

    1. First case: webservice can send response in parts, like first time it sends 20 items, and next time 20 items whenever user clicks on "Load more items" button.

    2. Second case: If you get 500 items in response, then to implement "Load more items" kind of functionality, you have to create database table to store all the items. Once you are done with database value storing, fetch 20 items initially, next time load 20 items and so on.

提交回复
热议问题