我用CAShapeLayer创建了一个圆。我想在修复中心旋转这个圆。我正在使用以下代码进行动画制作。使用这个代码圆是旋转的,但不是在修复中心。中心不断变化。我不希望这种情况发生。在特定中心旋转圆圈
这是我的动画代码
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 * rotations * 2.0 ];
rotationAnimation.duration = 10.0; // rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = 1.0;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
[circle1 addAnimation:rotationAnimation forKey:@"rotationAnimation"];
感谢
[circle1 setAnchorPoint:(0.5,0.5)];这将保持它在里面。 – BhushanVU 2013-03-05 11:13:03