I had the same problem. This is because the touch event in iOS5 is prevented when a recorded gestureRecognizer event captures the event.
There are two solutions.
One:
1) Add a new look inside your view. It should have the same level for the buttons. The priority of the buttons should be higher than the new one.
2) change the call to "addGestureRecognizer" to a new view.
[self.newView addGestureRecognizer:tap]
Two:
1) Enter the code below. You must return NO when the dot is in the buttons.
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { CGPoint point = [gestureRecognizer locationInView:self.view]; NSLog(@"x = %.0f, y = %.0f", point.x, point.y); if (CGRectContainsPoint(self.testBtn.layer.frame, point)) return NO; return YES; }
ps. You must import QuartzCore.h to access the level attributes.
#import <QuartzCore/QuartzCore.h>
LEAD2M
source share