List Flex mobile防止项目呈现器状态被回收

List Flex mobile防止项目呈现器状态被回收,list,apache-flex,mobile,itemrenderer,states,List,Apache Flex,Mobile,Itemrenderer,States,我有一个自定义列表项渲染器,其中定义了两个自定义状态: <s:states> <s:State name="expand"/> <s:State name="collapse"/> </s:states> 当我单击最后一项的按钮时。。。这将是跟踪结果: collapse collapse expand 现在,当我通过调用此函数“arraycollection.refresh()”刷新数据提供程序时……结果如下: expand c

我有一个自定义列表项渲染器,其中定义了两个自定义状态:

<s:states>
    <s:State name="expand"/>
    <s:State name="collapse"/>
</s:states>
当我单击最后一项的按钮时。。。这将是跟踪结果:

collapse
collapse
expand
现在,当我通过调用此函数“arraycollection.refresh()”刷新数据提供程序时……结果如下:

expand
collapse
collapse

有人能解释一下这种情况吗?请注意,只有当
useVirtualLayout
设置为true时才会发生这种情况…

请在更新数据提供程序后尝试重新指定项目呈现程序

//update data provider
itemList.dataProvider = myCollection;
//update the item renderer
itemList.itemRenderer = new ClassFactory(cutomItemRenderer);

当然,此解决方案将更加占用资源。

请提供更多上下文。用于按example.hi@pascallemerer显示列表的代码请参考我在上面添加的新编辑
expand
collapse
collapse
//update data provider
itemList.dataProvider = myCollection;
//update the item renderer
itemList.itemRenderer = new ClassFactory(cutomItemRenderer);