views:

69

answers:

3

Hi! I'm starting to develop a simple application for iOS, and this application is a simple gallery of some photo (taken from a website). The first problem I encountered is how to create the view for the gallery.

The view should be something like this (or the Photo App): Sample View

however doing a view this way is problematic, first because it uses fixed dimension, and I think is a bit difficult to implement (for me).

The other way is to use a custom cell within a tableview, like this: custom cell

but it is still using fixed dimension.

What's the best way to create a gallery, without using any third part lib (like Three20)?

Thanks for any reply :)

PS. I think that using fixed dimension is bad because of the new iphone 4 (with a different resolution), am I right?

+3  A: 

You should check out AQGridView which does exactly what you are trying to achieve. Even if you want to write your own custom code, have a look at the AQGridView source as more than likely you will need to use a UIScrollView as a base.

keno
A: 

If you don't want to use a third party library, you should do this in UITableView rows. Because of the way UITableView caches cells, it's relatively lightweight in memory. Certainly more so than a possibly very large UIView inside a UIScrollView. I've done it both ways, and I was much happier with the UITableView.

That said, next time I need to do this? I plan to use AQGridView.

Dan Ray
A: 

In case that you want to use third party classes, the next tutorials can be mixed, they worked for me. Here's a good grid view:
http://www.raywenderlich.com/130/how-to-write-a-custom-image-picker-like-uiimagepicker

And if you want to load them asynchronously, use this: http://iphonedevelopment.blogspot.com/2010/05/downloading-images-for-table-without.html

Both tutorials are very well described and have source code.

iPhoneDevProf