- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
UIView *hitView = [super hitTest:point withEvent:event];
if(hitView == self){
return nil;
}
return hitView;
}
只需要在上层视图的View中添加这个代码就可以了。
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
UIView *hitView = [super hitTest:point withEvent:event];
if(hitView == self){
return nil;
}
return hitView;
}
只需要在上层视图的View中添加这个代码就可以了。
转载于:https://www.cnblogs.com/wlsxmhz/p/8509825.html