本文介绍了在 UIImageView 中旋转图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
是否可以只旋转 UIImageView 中的图像?我正在寻找有关它的信息,但我只找到了如何旋转 UIImageVeiw 的信息.
Is it possible to rotate only image in UIImageView? I'm looking for information about it, but i only found information how rotate UIImageVeiw.
推荐答案
您可以使用以下代码旋转图像.请注意,这使用了一个 CGImageRef,您可以通过
You can rotate the image with the following code. Note, this uses a CGImageRef which you can get from a UIImage via
获得旋转后的图像后,您可以将 ImageView 的图像设置为新的旋转图像,如下所示:
Once you get the rotated image, you can set the ImageView's image to your new rotated image like this:
这是一个旋转 imageRef 的方法:
here is a method that will rotate the imageRef:
这篇关于在 UIImageView 中旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!