简体   繁体   中英

How recycler view Data bind?

回收者如何一次或一次查看绑定数据?

void onBindViewHolder (VH holder,int position,List<Object> payloads)

Called by RecyclerView to display the data at the specified position. This method should update the contents of the itemView to reflect the item at the given position.

So one by one. More here .

Your recycler view calls RecyclerView.Adapter when you set adapter to recycler view or notify dataset changes to the adapter.

Recycler view calls OnBindViewHolder for each item in your recycler.

Hence, recyclerview binds data one by one. You can clearly see this when you implement animation to the recycler view items.

RecyclerView is a list drawing library that essentially provides a fixed-size window to load a large dataset into. It recycles the views it created at the begining when the views go out of scope (window) and then if there is a need, reuses them to make it seem as if the views were never offloaded and were virtually present outside the window.It binds the rows which are visible to you and recycles the rest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM