UITapGestureRecognizer和UItableview共存,按钮动作不响应

http://blog.csdn.net/quanqinyang/article/details/17376973


UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hideTabelView:)];

tap.cancelsTouchesInView = YES;

tap.delegate = self;

[_veilView addGestureRecognizer:tap];


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

if ([touch.view isKindOfClass:NSClassFromString(@"UITableViewCellContentView")]) {

return NO;

}

return YES;

}

你可能感兴趣的:(UITapGestureRecognizer和UItableview共存,按钮动作不响应)