简体   繁体   English

iOS 翻转 UIImageView 180 度(非动画)

[英]iOS Flip UIImageView 180 degree (not animated)

How can I flip a UIImageView 180 degrees, but NOT animating the flip.如何将UIImageView翻转 180 度,但不为翻转设置动画。 I just want when it loads, to show it 180 degrees of the original image.我只是想在加载时以 180 度的角度显示原始图像。

In viewDidLoad or in the method where you are loading the image, do the following:viewDidLoad或加载图像的方法中,执行以下操作:

imageView.transform = CGAffineTransformMakeRotation(M_PI);

Hope this helps.希望这可以帮助。

斯威夫特 5.2

imageView.transform = CGAffineTransform(rotationAngle: CGFloat.pi)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM