我有一个 keyframeAnimation 并定义了一个路径,但动画不起作用。
你看有什么不对吗?:S
这是代码:
CAKeyframeAnimation *animKF = [CAKeyframeAnimation animationWithKeyPath:@"position"];
CGMutablePathRef animationPath = CGPathCreateMutable();
CGPathMoveToPoint(animationPath, NULL, 300, 100);
CGPathAddArcToPoint(animationPath, NULL, 300, 100, 800, 500, 500);
animKF.path = animationPath;
animKF.duration = 3;
animKF.rotationMode = kCAAnimationRotateAuto;
[imageView.layer addAnimation:animKF forKey:@"keyframe"];
太感谢了