概述
-
简介
- CAKeyframeAnimation又称关键帧动画
- CAKeyframeAnimation是抽象类CAPropertyAnimation的子类,可以直接使用
- 通过values与path两个属性指定动画属性
-
注意事项
- 若指定了path属性,则values属性将被忽略
- CABasicAnimation相当于只有两个关键帧的CAKeyframeAnimation
关键帧动画的常用属性
-
values(NSArray *)
- 存放关键帧的多个值
- 类似于CABasicAnimation的fromValue与toValue值
-
path(CGPathRef)
- 动画的执行路径
- 可以通过绘图的方式绘制路径
-
keyTimes(NSArray *)
- 每个关键帧的执行时间
- 类型为NSNumber类型
- 若不指定,则所有的关键帧平分动画的duration时长
-
timingFunctions(NSArray *)
- 速度控制函数数组
-
calculationMode(NSString *)
- 指定关键帧的动画属性
- 若指定该值,则keyTimes与timingFunctions属性值将被忽略
- 默认为:kCAAnimationLinear
-
rotationMode(NSString *)
- 指定旋转模式,默认为nil