is it possible that when recyclerview load items just load one time and dont reload scrolling?

☆樱花仙子☆ 提交于 2019-12-13 09:12:21

问题


is it possible that when recyclerview load items just load one time and dont reload scrolling? I want to load all data before loading it to my recyclerView.


回答1:


You can absolutely do that.

  1. Load all the data (through a web service call or by any other means).
  2. When data are retrieved, set them to the RecyclerView's adapter and call notifyDatasetChanged()).
  3. Use the RecyclerView normally (i.e. binding data objects to the views in onBindViewHolder().

This way you will get what you want (having all data and not needing to load more as the user scrolls) and the benefits of the RecyclerView, that creates as many views as needed.



来源:https://stackoverflow.com/questions/49025545/is-it-possible-that-when-recyclerview-load-items-just-load-one-time-and-dont-rel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!