I have a UIScrollView with several UIViews containing a UIImageView and a UILabel in it. When one of these Images is Single-Tapped, a Box with a individual Text is displayed. But now I also want to implement the possibility to zoom and scroll into the Images (show a UIImageView with the images in a ScrollView, that’s not the problem actually). But I need to know, when the picture is Double-Tapped.
I currently use a UITapGestureRecognizer with NumberOfTapsRequires:1 to show the Box with the Texts. But a second UITapGestureRecognizer with required touches of 2 doesn’t work, because the first Recognizer is shot before and displays the box over the whole Screen.
Maybe you have a idea, how to realize this. It would be good, if it is a UITapGesture-Solution 🙂
I’ve tried it like this now, but it still doesn’t work:
UITapGestureRecognizer *gR;
gR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(ScrollView_onTap:)];
[gR setNumberOfTapsRequired:1];
[tmpPage addGestureRecognizer:gR];
gR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showFunctionMenu:)];
[gR setNumberOfTapsRequired:2];
[tmpPage addGestureRecognizer:gR];
[gR release];
gR = nil;
The second recognizer is only shot sometimes, but mostly the first. Any ideas?
@Kevin I think you want to define the
numberOfTapsRequiredand notnumberOfTouchesRequiredboth are different things. Check the documentation on the same for more clarityhttp://developer.apple.com/library/ios/#documentation/uikit/reference/UITapGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UITapGestureRecognizer