【发布时间】:2020-09-29 20:51:11
【问题描述】:
我正在尝试让 UIImageView 旋转,所以它会从这个角度看(在方面适合):
对此:(对不起规模)
这是我用来尝试旋转 imageView 的代码:
// rotate the imageView
let transform = CGAffineTransform(rotationAngle: .pi/2)
self.imageView.transform = transform
这种方法有效,但是会截掉大部分图像,看起来像这样:
我该怎么做?提前致谢!
【问题讨论】:
-
为什么不旋转图像视图,而不是旋转图像?这有意义吗?
-
@matt 不,因为我也想用它来旋转添加到 UIView 中的 AVPlayerLayer。但是,如果你可以看看我的这篇文章:stackoverflow.com/questions/64110082/… 谢谢!
标签: ios swift xcode rotation imageview