_lowView 添加了單擊手勢
[self.view addSubview:_lowView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(lowViewTap)];
[_lowView addGestureRecognizer:tap];
造成的結果: table單擊cell,正常單擊無反應,需要長按幾秒才返回正常值。
解決方法:
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(lowViewTap)];
tap.delegate = self;
[_lowView addGestureRecognizer:tap];
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {
return NO;
}
return YES;
}