0

我有一个UIImageView,当我触摸它时,我可以通过以下方式获得触摸的位置:

[touch locationInView:theUIImageView]

问题是当我旋转 UIImageView 时:

theUIImageView.transform = CGAffineTransformMakeRotation(DegreesToRadians(arc4random()%15));

[touch locationInView:theUIImageView]不再返回水龙头的正确位置!*喘气!

关于如何获得的任何建议real tap location

4

1 回答 1

-1

选择要在 locationInView 中使用的不同(可能是父级,未旋转的)视图。如果你需要一个不同的坐标系,你总是可以在旋转之前根据 UIImageView 的框架添加自己的偏移量。

于 2012-04-11T01:41:49.130 回答