Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个项目,您可以在屏幕上拖动 UIImageView 以完成不同的功能,但是视图中的实际图像是静态的,我实际上希望它旋转到您拖动的角度,所以如果您将 UIImage 向左拖动,我想要图像向左旋转并停留在那里,如果你向上拖动图像旋转到向上位置等。
您可以对视图变换应用旋转:
view.transform = CGAffineTransformMakeRotation(angleInRadians);
您也可以随时删除转换:
view.transform = CGAffineTransformIdentity;