开发者

How can I combine multiple CAKeyframeAnimations into single keyframe animation?

开发者 https://www.devze.com 2023-01-23 16:28 出处:网络
Say I want to combine transform CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@\"transform\"];

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

精彩评论

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