Flex tilelist itemrender实例不匹配数据提供者的长度 [英] Flex tilelist itemrender instance not match the dataprovider length

查看:166
本文介绍了Flex tilelist itemrender实例不匹配数据提供者的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用自定义的itemrenderer作为我的Tilelist控件。当我运行我的应用程序。我发现customitemrenderer的实例计数不等于dataprovider listItem计数。数据提供者列表中只有一个项目,但有2个customitemrenderer实例。
我没有找到原因。有谁能够帮助我。
非常感谢!

解决方案

对于基于列表的组件,flex会提高效率。设想一个有1000行的数据提供者,但是瓦片列表一次只能显示9(3X3)。创建了1000个用户界面组件但不显示会浪费内存,所以f​​lex将创建它需要在屏幕上显示的9个渲染器以及额外的缓冲区数量。滚动tilelist时,缓冲区中的渲染器将成为下一个出现在列表中的渲染器,而刚刚滚动的渲染器将进入要回收的缓冲区。

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!

解决方案

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.

这篇关于Flex tilelist itemrender实例不匹配数据提供者的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆