Spark List 中的 itemChangeEffect 等效项是什么? [英] Whats the itemChangeEffect equivalent in Spark List?

查看:35
本文介绍了Spark List 中的 itemChangeEffect 等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 flex 3 中,使用 List 组件,您可以向 itemChangeEffect 属性添加效果,允许您为列表控件中的项目的添加/删除设置动画.

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.

spark 列表中的等效项似乎是 rendererAdd 和 Removed 事件,但这并不能完全控制效果,因为一旦调度事件就完成删除,没有时间处理效果.

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?

推荐答案

在 Stack Overflow 上查看这个答案:在 Flex 4 中为子元素设置动画.

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

Flex 3 列表将 itemChangeEffect/dataChangeEffect 融入其中,他们必须在 List 组件内部进行大量自定义配置才能实现这一点.因为 Spark 更新很多,架构也更好,所以它们没有在组件中包含任何效果处理,所以你不能做 itemChangeEffects 之类的事情.

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.

不过,您可以做的是在布局中创建效果.如果你想创建一个 AnimatedVerticalLayout,你需要做的就是扩展它们的 VerticalLayout 并覆盖 updateDisplayList,然后使用 TweenMax 来动画你的项目进入和退出它们的状态.这不是很容易:/但这是您现在唯一可以真正做的事情.不过,一旦有人自动执行此过程,就会变得轻而易举.

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.

祝你好运!

看看这个例子:动画Gilles Guillemin 的 TimeMachine 布局.他有一些好东西.

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

这篇关于Spark List 中的 itemChangeEffect 等效项是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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