Thursday, February 6, 2014
Questions about the principles of between ListView and Adapter
1, on the phone when sliding listView list, adapter is how to load the layout and data, assuming the list is very long, is the number of rows or first-time finish loading the phone screen to load only able to accommodate?
2, there is a list of why I slide, you can see a list of already loaded next good caching mechanism adapter is how was it?
3, Why holder can play a role in the cache, then it is also based on the principle of what role to play in the cache adapter as well?
Beg you explain? ? Thank you
Reply:
To look at the source code download, the more aware of some
Reply:
Certainly once finished loading. Caching mechanism is to save the data slightly. . Nothing of.
Reply:
Should be fully loaded, and you can see part of the draw method of the currently displayed items by getView
Reply:
1 adapter is not responsible for loading data, and the view is only responsible for data binding, data sources themselves set the layout in getview inflate it, the list is long, is not a one-time load is complete, see if you join the paging logic.
2 adapter itself is not what the caching mechanism, the actual buffer cache mechanism also depends on the data source, as convertView dependent on listview inside of itemview cache.
3 holder is actually a thinking space for time, time to give the province the findViewById down. There is only temporarily put inside each element itemview down to the cache.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment