iOS 阻止子视图响应父视图手势
2021-01-28 本文已影响0人
liang1030
实现手势以下代理方法:
#pragma mark --UIGestureRecognizerDelegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
if ([touch.view isDescendantOfView:self.sonView]) {
return NO;
}
return YES;
}