我正在寻找我所说的 CGPathContainsPoint 的逆。我在 UIView 中有一系列可点击区域,如果用户点击,我需要找出用户点击的区域。
除了使用 CGPathContainsPoint 检查每个区域之外,是否有更好的方法来简单地确定哪个 CGPath 被点击了?
谢谢!
最佳答案
if (CGPathContainsPoint(path, NULL, touchpositionInView, NO)){
BOOL PathContainsPoint = YES;
}
if (CGPathContainsPoint(path2, NULL, touchpositionInView, NO)){
BOOL Path2ContainsPoint = YES;
}
//...
我不明白这段代码有什么问题?
关于ios - 确定哪个 CGPath 被窃听,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22183964/