How to rotate UIImage

后端 未结 10 876
既然无缘
既然无缘 2021-01-03 23:03

I\'m developing an iOS app for iPad. Is there any way to rotate a UIImage 90º and then add it to a UIImageView? I\'ve tried a lot of different codes but none worked...

10条回答
  •  猫巷女王i
    2021-01-03 23:47

    UIImage *img = [UIImage imageWithName@"aaa.png"];
    UIImage *image = [UIImage imageWithCGImage:img.CGImage scale:1.0 orientation:UIImageOrientationRight];
    

提交回复
热议问题