I have a UIView that has a UIScrollView as a subview, which in turn has a UIImageView as its subview . I am able to zoom also. But I want to call another function on double tap. Im using this code:
- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view
{
if(view == scrollView)
{
UITouch *touch = [touches anyObject];
if([touch tapCount]== 2)
{
[self setViewForProductDispaly];
return YES;
}
}
return NO;
}
The above method is not getting called when i tap it.What might be the reson for this.
my scrollview
scrollView.hidden=NO;
scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0, 0.0,self.bounds.size.width,self.bounds.size.height )];
scrollView.maximumZoomScale = 3.0;
scrollView.indicatorStyle = UIScrollViewIndicatorStyleBlack;
scrollView.delegate =self;
scrollView.bouncesZoom = YES;
scrollView.delaysContentTouches=NO;
bigImageView.autoresizesSubviews = YES;
bigImageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
bigImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 0.0, bigImg.size.width, bigImg.size.height)];
bigImageView.image = bigImg;
bigImageView.userInteractionEnabled = YES;
[scrollView addSubview:bigImageView];
[bigImageView release];
[self addSubview:scrollView];
[scrollView release];