本文介绍了如何删除一个Spark Listform中的itemrenderer用于移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我有一个带有自定义mxml itemRenderer的$ ListForm,
所有的itemRenderer都是: < s:标签文本={data.name}/>

当我运行分析器时,listform不会再使用itemRenderer,
实例不断上涨,
我使用arrayCollection作为数据提供者。
我甚至调用dataprovider(arrayCollection).removeAll()和
显示为空,但itemRenderer的实例数
没有下降。然后我在分析器中运行垃圾回收器,
项目渲染器仍然保留在内存中。如何从内存中删除itemRenderer?

解决方案

如果您只想将标签作为项目渲染器,那么在移动应用程序中,要使用
LabelItemRenderer


I've got a spark ListForm with a custom mxml itemRenderer,all the itemRenderer has is:

<s:Label text="{data.name}" />

When I run the profiler, the listform is not re-using the itemRenderers,the instances keep going up and up,I'm using an arrayCollection as the dataprovider.I even call the dataprovider (arrayCollection) .removeAll() and thedisplay goes blank, yet the number of instances of the itemRenderer doesnot go down. I then run the garbage collector in the profiler, and theitem renderers still stay in memory. How can I remove the itemRenderers from memory?

解决方案

if you just want a label as an item renderer then in mobile applications it's recommended to use the LabelItemRenderer

这篇关于如何删除一个Spark Listform中的itemrenderer用于移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 16:08