views:

447

answers:

1

Hi,

I need and Activity indicator spinning in a modal Modal view that has an UIScrollView while the content of the ScrollView(image from url) is loading.

Any ideas of how to get this done?

As a plus I need to know how to tell the ScrollView to behaves like the Photos Iphone Native App, I mean, load an image, adjust it to fit the screen without loosing aspect ratio.

Thanx!!!! have everybody a nice day

+2  A: 

You need to use two steps:

  • First, download the image and display the activity indicator
  • When done, display the image and remove the activity indicator

The tricky part is it probably won't work if you just use NSData's initWithContentsOfURL: because it is a blocking call. On the Mac you can use NSURLDownload to download content asynchronously, you should check if this is available on the iPhone SDK.

For using a UIScrollView to display an image and fitting it to the screen at first, you should check the ScrollViewSuite sample code. It does exactly what you are looking for.

Taum
Thanx for the answer man, I'll try NSURLDownload and the ScrollViewSuite (downloading now =D). Thanks man... cheers
Omer