Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retina/non-retina images in UIImageView

I have a 300 x 300 sized UIImageView in my app which is displaying my images very nicely. My images are all 600 x 600 or larger and UIImageView simply resizes them for me.

My question is this: as these images are essentially all retina images anyway (i.e. double the required pixel size) is there any point in making a retina and a non-retina version of the same image? Won't this just make my app bigger because of the extra image files?

What's wrong with just letting the device downscale the images? I'm sure there's a very good answer so I'd like to know what it is!

Thanks for your advice.

like image 864
Glib Avatar asked Jan 10 '11 18:01

Glib


2 Answers

Scaling the images is an unnecessary overhead. Just provide two versions of it.

like image 181
Simone D'Amico Avatar answered Sep 21 '22 04:09

Simone D'Amico


For our apps we use a combination of the @2x images and doing what you've suggested, Scaling. We use the @2x images for bar buttons, icons, etc. But for UIImageViews we often just use the Scaling.

Here is an article that suggests both: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/

Ignore the part about the iPad not supporting @2x (that is old information) but the article is still good.

There can be a performance hit for doing this, but for most apps I'd say this is negligible. The savings in file size sometimes make scaling the only option.

like image 35
theChrisKent Avatar answered Sep 20 '22 04:09

theChrisKent