Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 基于参考点旋转图像_Ios_Uiimageview_Xcode6_Image Rotation - Fatal编程技术网

Ios 基于参考点旋转图像

Ios 基于参考点旋转图像,ios,uiimageview,xcode6,image-rotation,Ios,Uiimageview,Xcode6,Image Rotation,我有一个代码,可以根据图像的几何中心像旋转器一样旋转图像。。。但是,由于图像本身是不对称的,我希望根据UIImageView的(x,y)坐标围绕特定参考点旋转它。 以下是我当前旋转图像的代码: self.spinnerView.center=CGPointMake(self.spinnerView.center.x, self.spinnerView.center.y); self.spinnerView.transform=CGAffineTransformMakeRotation (angl

我有一个代码,可以根据图像的几何中心像旋转器一样旋转图像。。。但是,由于图像本身是不对称的,我希望根据UIImageView的(x,y)坐标围绕特定参考点旋转它。 以下是我当前旋转图像的代码:

self.spinnerView.center=CGPointMake(self.spinnerView.center.x, self.spinnerView.center.y);
self.spinnerView.transform=CGAffineTransformMakeRotation (angle);
并阅读文档:

变换的原点是中心属性的值,或 层的锚点属性(如果已更改)。(使用层) 属性以获取底层核心动画层对象。)的 默认值为CGAffineTransformity

因此:

是关于主播点的:

可以使用单位坐标指定此特性的值 空间。此属性的默认值为(0.5,0.5),即 表示层边界矩形的中心。全几何 对视图的操作发生在指定点附近

// why u change center of View on itself??? o_O What you want with it?
self.spinnerView.center=CGPointMake(self.spinnerView.center.x, self.spinnerView.center.y);
self.spinnerView.layer.anchorPoint=CGPointMake(0, 0);
self.spinnerView.transform=CGAffineTransformMakeRotation(angle);