- 设置手势代理,实现UITapGestureRecognizer的一个代理方法
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
if ([touch.view isDescendantOfView:self.smallView]) {
return NO;
}
return YES;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
if ([touch.view isDescendantOfView:self.smallView]) {
return NO;
}
return YES;
}
本文标题:OC View添加手势,防止View上点击其他视图触发点击效果
本文链接:https://www.haomeiwen.com/subject/ifznyttx.html
网友评论