Zooming image in a scroll view
Posted
by iSharreth
on Stack Overflow
See other posts from Stack Overflow
or by iSharreth
Published on 2010-04-10T18:00:28Z
Indexed on
2010/04/10
18:03 UTC
Read the original article
Hit count: 313
I want to zoom an image in a scroll view. I used the below code. All are working fine, but the image is not zooming. Anyone please help. I am a beginner in iPhone app development.
I had connected the delegate to files manager and set max zooming to 5
I can see the image. But how can I zoom it.
IBOutlet UIScrollView *scrForImg; IBOutlet UIImageView *imgForScr;
(void)viewDidLoad { [super viewDidLoad];
NSString *imagePath = [NSString stringWithFormat:@"myImage.png"];
imgForScr.image = [UIImage imageNamed:imagePath];
}
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return imgForScr;
}
© Stack Overflow or respective owner