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

1、遵守代理 <UIGestureRecognizerDelegate>

2、实现代理方法

// 子视图不响应父视图的手势识别

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

{

    if ([touch.view isDescendantOfView:self.TUcalendarHeaderView] || [touch.view isDescendantOfView:子试图view]) {

        return NO;

    }

    return YES;

}

posted @ 2016-10-11 13:36  十点听风  阅读(982)  评论(0编辑  收藏  举报