可以穿透点击事件的View
2017-12-26 本文已影响35人
爱喝农药de清凉
重写这个 方法 实现View 点击穿透
-
(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;
}