子视图不影响父视图的手势识别

1、遵守代理  UIGestureRecognizerDelegate

2、实现代理方法

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

{

if ([touch.view isDescendantOfView:self.pickerBgView]) {

return NO;

}

return YES;

}

你可能感兴趣的:(子视图不影响父视图的手势识别)