我使用核心动画来制作动画视图。当动画停止时,视图将恢复到原来的值。我怎样才能停止恢复?这是我的代码
#define p(x,y) CGPointMake(x,y)
#define v valueWithCGPoint
...
CGPoint rectL=p(463, 473);
CGPoint rectR=p(503, 473);
NSValue *valueL = [NSValue v:rectL];
NSValue *valueR = [NSValue v:rectR];
NSArray *firstArray=@[valueL,valueR,valueL,valueR,valueL,valueR,valueL,valueR];
CAKeyframeAnimation * theAnimation;
// Create the animation object, specifying the position property as the key path.
theAnimation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
theAnimation.values=firstArray;
theAnimation.duration=5.0;
//theAnimation.calculationMode= kCAAnimationLinear;
// Add the animation to the layer.
[self.boView.layer addAnimation:theAnimation forKey:@"moveBackAndForth"];