问题
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.
- Load all the data (through a web service call or by any other means).
- When data are retrieved, set them to the
RecyclerView
's adapter and callnotifyDatasetChanged()
). - Use the
RecyclerView
normally (i.e. binding data objects to the views inonBindViewHolder()
.
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