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.
可能重复: 如何将 UIImage 旋转 90 度? 如何在 iPhone 中以编程方式将图像旋转 90 度?
我想在单击按钮时旋转我的图像视图。图像视图必须在左、右、上、下位置旋转。我是 iphone 开发的新手,所以我不熟悉很多方法,请帮助我。
-(IBAction)onClick:(id)sender { static int numRot = 0; yourImageView.transform = CGAffineTransformMakeRotation(M_PI_2 * numRot); ++numRot; }
您应该使用Transform 功能。 例如 -
myImageView.transform = CGAffineTransformMakeRotation(3.14159265);