目前我正在使用 UIRotationGestureRecognizer 来旋转我的图像,并且我的图像当前正在顺利旋转。
我正在使用的代码是
CGFloat imageRotationDegree;
if ([gesture state] == UIGestureRecognizerStateBegan || [gesture state] == UIGestureRecognizerStateChanged)
{
[gesture view].transform = CGAffineTransformRotate([[gesture view] transform], [gesture rotation]);
[gesture setRotation:0];
imageRotationDegree=[gesture rotation];
}
NSLog(@"Rotation in Degrees: %f", imageRotationDegree);
所以问题是它总是将旋转度打印为零。所以我无法保存当前的旋转度。
此外,如果我改变 [gesture setRotation:0];
到其他程度,则旋转不顺畅。
那么如何通过平滑旋转打印不同的旋转度数。