从特定侧面旋转UIImageView-iOS

从特定侧面旋转UIImageView-iOS,ios,iphone,objective-c,uiimageview,rotation,Ios,Iphone,Objective C,Uiimageview,Rotation,我想从特定侧旋转图像(UIImageView)(例如,右侧) 我通过以下方式了解:- float degrees = 20; //the value in degrees imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180); 但它是从中心旋转的 我想从一个特定的侧面旋转UIImageView(即左侧将位于其位置,右侧将更改其位置) 提前感谢。从中心旋转并将UIImageView移动到您想要的位置。结果将

我想从特定侧旋转图像(UIImageView)(例如,右侧)

我通过以下方式了解:-

float degrees = 20; //the value in degrees
imageView.transform = CGAffineTransformMakeRotation(degrees * M_PI/180);
但它是从中心旋转的

我想从一个特定的侧面旋转UIImageView(即左侧将位于其位置,右侧将更改其位置)


提前感谢。

从中心旋转并将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
框架。

谢谢你的回答,但我也希望保持右手点静止并从左旋转,我如何才能做到这一点?我不明白你的意思。请你澄清一下,或者提供一个例子,好吧,我是用我自己的逻辑做的,非常感谢你的帮助,你上面的代码帮了我很多!。。很高兴听到这个消息。你们做了什么?首先我创建了它的镜像,然后我将镜像旋转了180度,然后使用了你们的代码。。。。