0

我已经使用旋转图像UIRotationGestureRecognizer并且它工作正常。但是图像的宽度和高度增加了。

原始图像尺寸: x = 85.000000 , y = 83.000000 , 宽度 = 150.000000 , 高度 = 150.000000旋转
图像尺寸: x = 54.476551 , y = 52.476551 , 宽度 = 211.046906 , 高度 = 211.046906

如何处理这个问题?我正在尝试这样:

recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation);
recognizer.rotation = 0;
4

1 回答 1

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;

我希望它有帮助

于 2012-09-06T13:41:04.790 回答