假设我有一个这样的ViewStack:
<mx:ViewStack id="s" left="5" right="5" bottom="5" top="0" width="100%" height="100%" creationPolicy="all" minHeight="0">
<mx:Repeater id="repeater" dataProvider="{dp}" height="100%" width="100%" minHeight="0">
<mx:Box id="bx" label="{repeater.currentItem.label}" width="100%" height="100%" minHeight="0">
<mx:Label minHeight="0" width="100%" height="100%" label="bob" />
</mx:Box>
</mx:Repeater>
</mx:ViewStack>
由于堆栈中有大量的项(每个项都有大量的面板、数据绑定等),这会变得非常缓慢。无论viewStack本身的creationPolicy如何,中继器似乎都会触发所有子级的创建。
这个效率问题有现成的解决方案吗?我可以想出一些方法用自定义组件来解决这个问题,但我想知道对于内部值确实需要动态(由ArrayCollection支持)的情况,是否有现成的解决方案。