views:

139

answers:

2

Hi there,

Is it better to have a PNG, say 320px x 44px and display it once, or to have a PNG that is 320px x 4px and use [UIColor colorWithPatternImage:]?

I know that the iPhone handles PNGs well and decompresses them, so in terms of memory, would it be best to use the smallest possible images, and in this case, use the UIColor method to repeat it?

Are there any drawbacks to using colorWithPatternImage? Perhaps over larger areas, maybe half a screen size or full screen sized?

Many thanks,

Michael

+2  A: 

The answer depends on what "better" means to you. If you're more concerned about the size of the app, then smaller pictures would help you. If the application's speed is more of an issue than size, then a larger image will eliminate the need for all the colorWithPatternImage calls and effectively run faster.

Andres Bonilla
+2  A: 

I'm willing to bet that choosing one over the other won't make a noticeable difference in your app's responsiveness. The only place people might notice a difference is if they're downloading your app over EDGE, in which case the tiled image is the way to go.

I would do whatever makes your app most maintainable.

Frank Schmitt