- tapGesture.delegate = self;
- - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
- {
- CGPoint location = [touch locationInView:self.view];
- if(CGRectContainsPoint(button.frame, location))
- {
- return NO;
- }
- return YES;
- }
UIView上添加了一个按钮和一个单击手势的事件相应,互相不影响的处理方法。。
最新推荐文章于 2020-12-20 11:09:15 发布