如何在iOS中横向和纵向旋转图像?
问题描述:
在我的应用程序中只能在肖像模式下工作。但具有一个功能的应用程序是Gallery。在图库中,用户可以查看图像,我想以横向和纵向模式旋转图像。 如何在iOS中实现此功能。如何在iOS中横向和纵向旋转图像?
答
您可以通过此
self.imageview.transform = CGAffineTransformMakeRotation(M_PI * 90/180.0);//90 as in 90 degree
+0
这段代码我们可以在哪里写? –
+0
当你想旋转imageview? –
答
myImage.center = CGPointMake(0, 0);
myImage.transform = CGAffineTransformMakeRotation([degreesToRadians:imageRotationFix]);
图像旋转如ImageView的这可能帮助 - http://stackoverflow.com/questions/11667565/how-to-rotate-an- image-90-on-ios – Chetan