超级视图旋转后获取子视图位置
我有一个 UIView,它有几个响应触摸的子视图。如果我使用如下代码旋转超级视图的层:
[CATransaction begin];
[CATransaction setDisableActions:true];
view.layer.transform = CATransform3DRotate(view.layer.transform, angle, 0, 0, 1);
[CATransaction commit];
...那么在响应触摸事件时我似乎无法找到子视图的正确位置...有什么想法吗?
I have a UIView which has several subviews that respond to touch. If I rotate the layer of the superview with some code like this:
[CATransaction begin];
[CATransaction setDisableActions:true];
view.layer.transform = CATransform3DRotate(view.layer.transform, angle, 0, 0, 1);
[CATransaction commit];
... then I can't seem to find the right location of the subviews when responding to touch events... Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了它,我猜效果很好。我需要在 UIView 之间转换点以进行贝塞尔曲线命中测试:
I found it, worked out beautifully I guess. I needed to convert points between UIViews for doing bezier hit testing: