Whats the itemChangeEffect equivalent in Spark List?

扶醉桌前 提交于 2019-11-30 17:11:13

问题


In flex 3, with List component, you could add an effect to the itemChangeEffect property, allowing you to animate the addition/removal of the items in the list control.

The equiv in the spark list appears to be the rendererAdd and Removed events, but this doesn't allow complete control over the effect, since removal is done as soon as the event has been dispatched, allowing no time for the effect.

Does anyone know how to accomplish the same on a spark list?


回答1:


Check out this answer on Stack Overflow: Animating Child Elements in Flex 4.

Flex 3 Lists had the itemChangeEffect/dataChangeEffect baked into them, and they had to do a LOT of custom configuration inside of the List component to make that possible. Because Spark is a lot newer and a lot better architected, they have not included any effect processing in the components, so you can't do things like itemChangeEffects.

What you CAN do, though, is create effects in your layouts. If you wanted to create an AnimatedVerticalLayout, all you need to do is extend their VerticalLayout and override updateDisplayList, and then use TweenMax to animate your items in and out of their state. It's not very easy :/ but it's the only thing you can really do right now. Once someone automates this process though, it'll be a snap.

Good luck!

Check out this example: Animated TimeMachine Layout by Gilles Guillemin. He has some good stuff.



来源:https://stackoverflow.com/questions/1917566/whats-the-itemchangeeffect-equivalent-in-spark-list

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