UITapGestureRecognizer?

Your UIImageView won't pass touches to a UIGestureRecognizer unless you have set userInteractionEnabled = YES.

You are adding gestures to imageView, then you allocating a new UIImageView and adding to scrollView. Thats the problem I guess. Rearrange your code as, NSURL *imgUrl=NSURL alloc initWithString:@"

"; NSData *imgData = NSData dataWithContentsOfURL:imgUrl; UIImage *img = UIImage imageWithData:imgData; imageView = UIImageView alloc initWithImage:img; // set the tag for the image view imageView setTag:ZOOM_VIEW_TAG; // add gesture recognizers to the image view UITapGestureRecognizer *singleTap = UITapGestureRecognizer alloc initWithTarget:self action:@selector(handleSingleTap:); UITapGestureRecognizer *doubleTap = UITapGestureRecognizer alloc initWithTarget:self action:@selector(handleDoubleTap:); UITapGestureRecognizer *twoFingerTap = UITapGestureRecognizer alloc initWithTarget:self action:@selector(handleTwoFingerTap:); doubleTap setNumberOfTapsRequired:2; twoFingerTap setNumberOfTouchesRequired:2; imageView addGestureRecognizer:singleTap; imageView addGestureRecognizer:doubleTap; imageView addGestureRecognizer:twoFingerTap; singleTap release; doubleTap release; twoFingerTap release; self.

ImageScrollView addSubview:imageView; imgUrl release.

1 In addition to this, you should also consider downloading the image on the background and then add the image view to the scrollview. Since it seems to be static you might also consider saving the image to resources folder and then loading it. – Deepak Jul 27 at 12:57 @iAnand I do that but when I double click on image then it not work or can not detect tap on image.

Image can not zoom in or zoom out. – Neha Jul 28 at 4:22 when run this I get message on console that is unable to acess single and double tap. *** __NSAutoreleaseNoPool(): Object 0x4b4cc70 of class UIView autoreleased with no pool in place - just leaking – Neha Jul 28 at 12:01.

Also be sure to set to YES the UITapGestureRecognizer property. ImageView. UITapGestureRecognizer =YES.

This makes no sense. Neither does the +1 someone gave it. – Paul Lynch 2 days ago.

UITapGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for single or multiple taps. For the gesture to be recognized, the specified number of fingers must tap the view a specified number of times. Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the associated action message is sent when the gesture begins and is sent for each intermediate state until (and including) the ending state of the gesture.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions