I m doing zooming through this-
@interface ScrollViewController : UIScrollView {
UIImageView *imageView;
}
- (id)initwithImage:(UIImage *)image {
if (self = [super init]) {
// Custom initialization
_image=image;
imageView=[[UIImageView alloc]initWithFrame:CGRectMake(15, 20, 250, 250)];
[imageView setImage:image];
self.frame=CGRectMake(20, 30, 300, 350);
self.contentSize=CGSizeMake(350,400);
self.maximumZoomScale=4.0;
self.minimumZoomScale=0.75;
self.clipsToBounds=YES;
self.delegate=self;
[self addSubview:imageView];
}
return self;
}
I have detected double click on image as-
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if([[touches anyObject]view]==self)
{
NSSet *allTouches = [event allTouches];
switch([allTouches count])
{
case 1:{
UITouch *touch=[[allTouches allObjects]objectAtIndex:0];
switch([touch tapCount])
{
case 1:
break;
case 2:{
NSLog(@"Double tap");
//what should i do reset the image to it's original size.(15, 20, 250, 250))
}break;
}
}
}
}
}
(id)initWithImage:(UIImage *)productImage { if (self = [super init]) { // Custom initialization
scrollView=[[ScrollViewController alloc] initwithImage:productImage]; [self.view addSubview:scrollView];
} return self; }
I want the original size of UIImageView (which is in UISCrollView) when i double click on the image.
Please Please help me