Flex tilelist itemrender instance not match the dataprovider length

不羁的心 提交于 2019-12-13 19:40:18

问题


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.



来源:https://stackoverflow.com/questions/15897019/flex-tilelist-itemrender-instance-not-match-the-dataprovider-length

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!