2011-01-30 103 views
0

美好的一天!uiview旋转保持1坐标常数

我想问一下,如果我想在另一个视图中将uiview带到前面,但是我想通过保持其1个点不变,使它看起来像只有1个(顶部)部分向下移动。我把我的uiview放在90度的位置上,但我无法弄清楚如何使它水平。这里是UIView的代码

clView.frame = CGRectMake(0,100,258,171); 
clView.transform = CGAffineTransformIdentity; 
clView.transform = CGAffineTransformMakeRotation(degreesToRadians(90)); 
[self.view addSubview:clView]; 

现在它把我的观点到90度,但我不能与动画保持一个恒定的角度把它放下。像抛射体运动。有人可以帮我吗?

我想还是和其他移动黄色圆圈部分,90个辈分和恢复正常

Yellow circle part i want to be still and other moving, 90 degress and back to normal

回答

0

你可能要设置底层的CALayer的anchorPoint,到任何坐标表示的中间黄色的圆圈。因此,如下所示:

myView.layer.anchorPoint = CGPointMake(x,y); // where x and y is the middle of the yellow circle. 

一旦设置了anchorPoint,转换将在该点完成。

This page有更多细节。

+0

非常感谢ipmcc – 2011-01-30 20:13:00