博客> 手势冲突问题
手势冲突问题
2018-09-17 09:36 评论:0 阅读:290 默默besty

之前在界面上添加tab 手势,与table cell的点击事件发生冲突,查了很多资料,自己写一下,mark一下 遵守UIGestureRecognizerDelegate 协议 然后再 (BOOL)gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldReceiveTouch:(UITouch )touch

{

if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"] || [NSStringFromClass([touch.view class]) isEqualToString:@"UIView"]) {
    return YES;
}
return NO;

}

收藏
0
sina weixin mail 回到顶部