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 度并恢复正常
Good Day!
i want to ask that if i want to bring a uiview in front on another view, but i want to bring it by keeping its 1 points constant so that it looks like that only 1 (top) portion moved down. i put my uiview on 90 degrees but i could not figure out the way to bring it horizontal. here is code for uiview
clView.frame = CGRectMake(0,100,258,171);
clView.transform = CGAffineTransformIdentity;
clView.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
[self.view addSubview:clView];
Now it puts my view to 90 degrees but i could not bring it down with animation keeping one point constant. like projectile motion. Can somebody help me out ?
Yellow circle part i want to be still and other moving, 90 degress and back to normal
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想要将底层 CALayer 的锚点设置为代表黄色圆圈中间的任何坐标。就像这样:
一旦设置了锚点,就会对该点进行变换。
此页面对此有更多详细信息。
You probably want to set the anchorPoint of the underlying CALayer, to whatever coordinates represent the middle of the yellow circle. So something like:
Once you've set the anchorPoint, transforms will be done about that point.
This page has more detail on this.