Skip to content

CAAnimation:timingFunction 属性 ​

timingFunction 属性是动画的时间曲线,决定动画在时间上怎么分配进度:匀速,还是先慢后快。

值 ​

CAMediaTimingFunction,或者 null。

示例 ​

js
const move = CABasicAnimation.animationWithKeyPath('position');
move.fromValue = new CGPoint(30, 80);
move.toValue = new CGPoint(270, 80);
move.duration = 0.6;
move.timingFunction = CAMediaTimingFunction.functionWithName('easeOut');

效果:加到图层上之后,图层开始时移动得快,接近终点时慢下来。未在模拟器验证。

对应的 iOS API ​

CAAnimation.timingFunction。

参见 ​