我想从特定的一侧(例如右侧)旋转图像 (UIImageView)。
我知道:-
float degrees = 20; //the value in degrees
imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180);
但它从中心旋转。
我想从一个特定的一侧旋转我的 UIImageView(即左侧将在其位置,右侧将改变其位置)。
提前致谢。
最佳答案
尝试使用anchorPoint
属性。
imageView.layer.anchorPoint = CGPointMake(0, 0);//Top left angle
float degrees = 20; //the value in degrees
imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180);
不要忘记添加 QuartzCore
框架。
关于ios - 从特定一侧旋转 UIImageView - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20785839/