我正在尝试沿预先定义的路径移动图像。我使用下面的代码。但它说的是:
CAKeyframeAnimation undeclared
kCAAnimationPaced undeclared
我是iPhone开发的新手,请帮助我。
*pathAnimation = [CAKeyframeAnimationanimationWithKeyPath:@"position"];
pathAnimation.duration = 1.0f;
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = NO;
CGMutablePathRef pointPath = CGPathCreateMutable();
CGPathMoveToPoint(pointPath, NULL, 492, 128);
CGPathAddLineToPoint(pointPath, NULL, 480, 150);
CGPathAddLineToPoint(pointPath, NULL, 489, 160);
CGPathAddLineToPoint(pointPath, NULL, 489, 180);
pathAnimation.path = pointPath;
CGPathRelease(pointPath);
[imageview.layer addAnimation:pathAnimation forKey:@"pathAnimation"];