Reputation: 878
How can I insert an image in a scroll view, so that I can zoom it. I am new to objective c. Any help will be greatly appreciated!
Upvotes: 0
Views: 505
Reputation: 24820
you have to add following delegate method of scrollview in your *.m file.
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
}
Ok. Let me explain in deep.
IBOutlet UIScrollView *scrForImg;
IBOutlet UIImageView *imgForScr;
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return imgForScr;
}
Hope, It works for you dear. Add comment if any doubts.
Upvotes: 1
Reputation: 12217
Look into ImageKit. In particular, IKImageView. Theoretically, you can put that into your scrollview. I've been playing with this recently...
Granted, I only work in OSX, not iPhone, so your experiences may vary... I'm not sure that IKImageView exists for iPhone, but ImageKit seems to...
Upvotes: 0