I use the custom itemrenderer for my Tilelist control. When I run my application. I found that the customitemrenderer's instance count was not equal to the dataprovider listItem count. There are only one item in the dataprovider list, but got 2 customitemrenderer instances. I count'd not find the reason. Can anybody help me. Many thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
For list based components, flex does this for efficiency. Imagine a dataprovider with 1000 rows, but the tile list only displays 9 at a time (3X3). Having 1000 UI components created but not displayed would be a waste of memory so flex will create the 9 renderers it needs to have on the screen, plus a extra buffer amount. When you scroll through the tilelist, the renderers in the buffer will be the next ones to appear in the list, and the renderers that just scrolled off will enter the buffer to be recycled.