1
我试图转动它在左上角用行动一个UIButton一个UIView:旋转的UIView与按钮它
[email protected]"hello";
现在我旋转的UIView 180°和按钮现在在右下角。但是只有当我按下左上角时按钮才会触发它的动作...所以它像按钮的位置已经改变,但它的动作停留在旋转之前的相同位置?
我使用CAKeyframeAnimation
旋转视图。
CAKeyframeAnimation *rotationAnimation;
rotationAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.0 * M_PI],
[NSNumber numberWithFloat:0.75 * M_PI],
[NSNumber numberWithFloat:1.5 * M_PI],
[NSNumber numberWithFloat:2.0 * M_PI], nil];
rotationAnimation.calculationMode = kCAAnimationPaced;
rotationAnimation.removedOnCompletion = NO;
rotationAnimation.fillMode = kCAFillModeForwards;
rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
rotationAnimation.duration = 10.0;
CALayer *layer = [rotateView layer];
[layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
把你的旋转动画代码的细节 –