如何知道什么时候一个coreanimation动画结束 [英] how to know when a coreanimation animation ends

查看:150
本文介绍了如何知道什么时候一个coreanimation动画结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一些动画核​​心动画,但我不能找到一个办法知道一个通​​知或事件时的动画效果块完成,像UIView的动画块你有

I'm doing some animations with core animation, but I can't found a way to know with a notification or event when the animation block has finish, like in UIVIew animation block you have

setAnimationDidStopSelector:

我怎么能在核心动画知道这一点,感谢您的帮助。

how can I know this in core animation, thanks for any help

推荐答案

如果您使用的是 CAAnimation 实例,看 animationDidStop:成品:对于其委托

If you are using a CAAnimation instance, look at the animationDidStop:finished: for its delegate.

CAAnimation * animation = [CAAnimation animation];
animation.delegate = yourDelegate; // could be self, for example.
[yourLayer setAnimation:animation forKey:nil];

在上面的例子中, yourDelegate 应实施 animationDidStop:完成:方法能够检测动画结束。

In the example above, yourDelegate should implement the animationDidStop:finished: method to be able to detect the animation end.

这篇关于如何知道什么时候一个coreanimation动画结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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