0

再会!

我想问一下,如果我想将 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 度并恢复正常

黄色圆圈部分我想保持静止和其他移动,90 度并恢复正常

4

1 回答 1

0

您可能希望将底层 CALayer 的 anchorPoint 设置为代表黄色圆圈中间的任何坐标。所以像:

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

设置锚点后,将对该点进行转换。

此页面对此有更多详细信息。

于 2011-01-30T19:35:33.577 回答