- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
for (UIView *view in self.subviews) {
CGPoint viewP = [self convertPoint:point toView:view];
if ([view pointInside:viewP withEvent:event]) {
return view;
}
}
return [super hitTest:point withEvent:event];
}
其中Btn就是在self上超出的控件
网友评论