The ListView is a very important control in the Android UI control. It can be very intuitive to display a set of data, in practical applications is very extensive. The display and caching mechanism of the ListView is described below.
Here is a schematic of the ListView display caching mechanism:
The 1th part is the normal display of the ListView when a cell phone, because the mobile phone height is limited, so the data displayed is not too much, here shows 7 data; Similarly, because the memory resources of the mobile phone is limited, the ListView will not load all the data once and wait for you to slip, It will only load a portion of the screen that can be displayed;
The 2nd part is when we swipe up, Item1 is moved to the outside of the screen, when it is not visible, so the system puts it into the view buffer pool recycler;
At the same time ITEM8 needs to be loaded, so the system takes out the layout from the recycler buffer and fills it with data, showing the ITEM8, which is the 3rd part.
In summary, the display cache mechanism of the ListView is needed to display only display, after the display is retracted, the need-to-take caching mechanism greatly saves the system resources, so that the ListView can display tens of thousands of data.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The display and caching mechanism of the "Advanced Android" ListView