【发布时间】:2014-08-24 10:08:55
【问题描述】:
我有一个 UIView,我在上面添加了一个 UIButton。我将 UIView 旋转 180 度。旋转 UIView 后,它里面的所有东西看起来都旋转了,包括按钮。但是当我点击按钮时。它仅从其初始位置接收触摸事件。不是从它出现在屏幕上的位置。这是我的代码 -
CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.toValue = [NSNumber numberWithFloat:((180*M_PI)/180)];
fullRotation.speed = 1.0;
fullRotation.autoreverses = NO;
fullRotation.removedOnCompletion = NO;
fullRotation.fillMode = kCAFillModeForwards;
[_subView.layer addAnimation:fullRotation forKey:@"360"];
【问题讨论】: