我使用UIRotationGestureRecognizer
旋转图像并且工作正常。但图像宽度&身高增加了。
原始图像尺寸:x = 85.000000 ,y = 83.000000 ,宽度= 150.000000 ,身高= < EM> 150.000000
之后旋转图像尺寸:x = 54.476551 ,y = 52.476551 ,width = 211.046906 ,height = 211.046906
如何处理这个问题?我这样想:
recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation);
recognizer.rotation = 0;
答案 0 :(得分:0)
CGAffineTransform transform = self.view.transform;
if (UIDeviceOrientationLandscapeLeft == deviceOrientation) {
transform = CGAffineTransformRotate(transform, -(M_PI / 2.0));
} else {
transform = CGAffineTransformRotate(transform, M_PI / 2.0);
}
self.view.transform = transform;
我希望它有所帮助