views:

84

answers:

3

I know three20 has a PhotoViewController but it seems like overkill to just include the whole framework just to load one picture from one URL. Does anyone know of any code/lib that displays one picture when give one URL?

A: 

Have you tried UIWebView with just the URL?

mahboudz
+1  A: 

You could write your own in about five minutes. You'd need a UIViewController subclass managing a UIImageView. Init the VC subclass with an NSURL, and then download the contents of the NSURL into an NSData object. Use the NSData object to create a new UIImage. Set the image property of the UIImageView to the downloaded image.

After you spend five minutes on that, you could spend another two minutes to make the ViewController interaction-safe by downloading the image on a second thread.

(It took me longer to find all the appropriate links than it'd take to write your own)

Dave DeLong
the problem with that is the UIImageView will not be draggable like how it would be in the Photo app. Even though there is only one photo users still expecting to be able to drag and zoom.
erotsppa
@erotsppa then embed the UIImageView in a UIScrollView...
Dave DeLong
A: 

Three20 has a TTImageView which displays an image from a given URL I believe.

Kevlar