- 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上添加了一个按钮和一个单击手势的事件相应,互相不影响的处理方法。。
最新推荐文章于 2018-04-12 17:00:46 发布