本文介绍了如何获得CABasicAnimation进展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关 NSAnimation 开发者文档中我发现 -addProgressMark 方法。对于 CABasicAnimation 我没有发现类似的事情。

For NSAnimation in developer documentation I found the -addProgressMark method. For CABasicAnimation I didn't find anything similar.

CABasicAnimation * rotateLayer = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"];

在动画进度 rotateLayer = 50%,我想做些什么?
我该怎么做呢?

When animation progress rotateLayer = 50% I want do something...How do I do this?

推荐答案

您也许可以使用的NSTimer 来做到这一点。

You could maybe use a NSTimer to do this.

在动画开始感谢 animationDidStart你可以知道: CAAnimation 的委托方法(其中 CABasicAnimation 从引用)。

You can know when the animation starts thanks to the animationDidStart: delegate method of CAAnimation (of which CABasicAnimation inherits from, reference).

你既然知道动画持续多久(您设置的动画的持续时间),你可以做任何你需要一次动画击中其持续时间的50%。

Since you know how long the animation lasts (you set the duration of the animation), you can do whatever you need once the animation hits 50% of its duration.

我的2美分:)

这篇关于如何获得CABasicAnimation进展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-20 23:26