2015-09-04 90 views
2

在我的應用程序中只能在肖像模式下工作。但具有一個功能的應用程序是Gallery。在圖庫中,用戶可以查看圖像,我想以橫向和縱向模式旋轉圖像。 如何在iOS中實現此功能。如何在iOS中橫向和縱向旋轉圖像?

+2

圖像旋轉如ImageView的這可能幫助 - http://stackoverflow.com/questions/11667565/how-to-rotate-an- image-90-on-ios – Chetan

回答

2

您可以通過此

self.imageview.transform = CGAffineTransformMakeRotation(M_PI * 90/180.0);//90 as in 90 degree 
+0

這段代碼我們可以在哪裏寫? –

+0

當你想旋轉imageview? –

0
myImage.center = CGPointMake(0, 0);  
myImage.transform = CGAffineTransformMakeRotation([degreesToRadians:imageRotationFix]); 
相關問題