views:

322

answers:

3

Hello guys!

I need to display 10 - 1000 images on a UIScrollView. Paging is enabled. So every page of the scrollview is an image, it is an uiimage. I can load 10 images to 10 uiimages which stays in the memory, but with 1000 images I have problems on the iPhone or on the iPad. I am trying to unload and then load the images when I am doing scrolling. I every time displays 3 images. The current page image, and the -1 and +1 pages. When I am scrolling I unload the image and then load the next. With this method I have two problems. The scrolling is laggy and if I scroll very fast the images don't appear. Maybe is there any good solution for these problems? Can you suggest me one?

+1  A: 

You should use a table with large custom cells each containing one image view. That way you never have more than a few image views in existence at anyone time. The table will manage swapping out the images that should be visible for you so you don't have to write all that code yourself.

However, even with a table you will get poor performance if you try to display 1,000 large (say 20%+ of screen size) images. I haven't tried this on the iPad but the iPhone just doesn't have the horsepower and memory to handle that many images quickly.

Instead, you should copy the Photo Library's hierarchical system. Present thumbnails and then a detail view for the full image or a side to side scrolling detail view that only shows one image at time. This has the added advantage of being an interface the user is already perfectly familiar with.

TechZen
I'll try it. Thanks, it is a good idea to use a tableview.
Infinity
One more question. Is there a way to use the tableview in horizontal mode?
Infinity
So, in tableView I can't enable paging... However I made a tableview which has horizontal scrolling without vertical scrolling, but I need paging... Do anybody have any idea?
Infinity
Tables don't page. Not sure what you need exactly. I think you're trying to cram a desktop interface into a mobile. You can't do that and expect good performance. You have to work within the limitations of the low-power mobile hardware and adapt your design accordingly.
TechZen
I would like to make a book-like interface and I saw some good book interfaces which was very fast at page scrolling pages. My interface is a bit laggy. I just want to speed up page scrolling.
Infinity
A: 

Do anybody have any idea about this?

Infinity
+1  A: 

Perhaps the TTPhotoViewController from the three20 project would be useful.

Jason Jenkins
I hope it will be useful. :)
Infinity