Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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
Objective c uiview旋转保持1坐标不变_Objective C_Core Animation_Uiviewanimation_Image Rotation - Fatal编程技术网

Objective c uiview旋转保持1坐标不变

Objective c uiview旋转保持1坐标不变,objective-c,core-animation,uiviewanimation,image-rotation,Objective C,Core Animation,Uiviewanimation,Image Rotation,你好 我想问一下,如果我想把一个uiview放在另一个视图的前面,但是我想通过保持它的1点不变,使它看起来只有1(顶部)部分向下移动。我把视线调到90度,但我想不出使它水平的方法。以下是uiview的代码 clView.frame = CGRectMake(0,100,258,171); clView.transform = CGAffineTransformIdentity; clView.transform = CGAffineTransformMakeRotation(degreesToR

你好

我想问一下,如果我想把一个uiview放在另一个视图的前面,但是我想通过保持它的1点不变,使它看起来只有1(顶部)部分向下移动。我把视线调到90度,但我想不出使它水平的方法。以下是uiview的代码

clView.frame = CGRectMake(0,100,258,171);
clView.transform = CGAffineTransformIdentity;
clView.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
[self.view addSubview:clView];
现在它将我的视角调到90度,但我无法通过动画将其调低,使一个点保持不变。就像弹丸运动一样。有人能帮我吗

黄色圆圈部分我希望静止,其他移动,90度,恢复正常


您可能需要将底层CALayer的锚点设置为表示黄色圆圈中间的任何坐标。比如:

myView.layer.anchorPoint = CGPointMake(x,y); // where x and y is the middle of the yellow circle.
一旦设置了锚点,将对该点进行变换

有更多的细节