开发者

How can I combine multiple CAKeyframeAnimations into single keyframe animation?

Say I want to combine transform

CAKeyframeAnimation *animation = [CAKeyframeAnimation
   animationWithKeyPath:@"transform"];

and opacity

CAKeyframeAnimation *animation = [CAKeyframeAnimation
   an开发者_开发问答imationWithKeyPath:@"opacity"];

into keyframe animation. How do I combine and specify transform/opacity values for each keyframe?


Create two animations just like you do, use the same keyTimes for both of them, and add them both to the layer with addAnimation:forKey:. It's that easy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜