views:

56

answers:

1

Hello, I have a UIImageView, which pics up different images from the web, they are all different res. I have them to display as Aspect fit so that the whole picture displays even if it means leaving empty space on top or sides.

What i want to have the feature of doing is, once its displayed, to zoom in and out using the pinch or any other way.

NSURL* iURL = [NSURL URLWithString:tURL];

NSData* iData = [NSData dataWithContentsOfURL:iURL]; UIImage* iImage; iImage = [UIImage imageWithData:iData]; FullScreenImage.image = iImage;

All this code is being executed on another thread, then it returns to the main thread and is displayed on a view using

 [navigationController pushViewController:vFullscreen animated:YES];

Thanks for the help

A: 

You will need to use a UIScrollView as UIImageView does not offer any built-in zooming. See the Apple example entitled: ScrollViewSuite

Run Loop
Thanks, When i had a quick look, i needed to know the dimensions of the image, but with images when im downloading, i can not provide this on the fly :/
Once the image is downloaded, you can get its size from UIImage's size method which you can then use for the scrollview.
Run Loop