动画分类:
- CAKeyframeAnimation:
属性说明: - path: 路径
- calculationMode:控制关键帧时间
The appropriate values in the keyTimes array are dependent on the calculationMode property.
If the calculationMode is set to kCAAnimationLinear, the first value in the array must be 0.0 and the last value must be 1.0. Values are interpolated between the specified key times.
If the calculationMode is set to kCAAnimationDiscrete, the first value in the array must be 0.0.
If the calculationMode is set to kCAAnimationPaced or kCAAnimationCubicPaced, the keyTimes array is ignored。
CA_EXTERN NSString * const kCAAnimationLinear;
CA_EXTERN NSString * const kCAAnimationDiscrete;//只展示关键帧的状态,没有中间过程,没有动画
CA_EXTERN NSString * const kCAAnimationPaced;//向被驱动的对象施加一个恒定速度,不管路径的各个线段有多长
CA_EXTERN NSString * const kCAAnimationCubic;
CA_EXTERN NSString * const kCAAnimationCubicPaced;
-
fillMode:一般设置为kCAFillModeForwards:保存最新的状态;
-
repeatCount:重复次数;
-
autoreverses:是否原路返回;
-
keyTimes:可以为对应的关键帧指定对一个时间点,keyTimes每一帧都对应values的每一帧,没有设置的话,那就都是平分时间;
-
values:存放关键帧的数组;
-
timingFunction:设置动画运动的速度;
pathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; CA_EXTERN NSString * const kCAMediaTimingFunctionLinear; CA_EXTERN NSString * const kCAMediaTimingFunctionEaseIn; CA_EXTERN NSString * const kCAMediaTimingFunctionEaseOut;//动画开始较慢,中间会加速,临近结束会变慢 CA_EXTERN NSString * const kCAMediaTimingFunctionEaseInEaseOut; CA_EXTERN NSString * const kCAMediaTimingFunctionDefault;
-
removedOnCompletion:设置为NO,可以取消反弹,保持动画执行完毕后的状态;
网友评论