Search code examples
objective-cxcodeios-simulatorretina-display

Retina graphics vs non-retina graphics management


I am about to launch a new app and would lik eto increase quality of the graphics. In my case the graphics is the logo and the custom buttons. I do not know if this impact Core Plot but that is also part of the package.

There is quite a few posts about this but there are still things i do not fully understand.

I am reading this quote from "amattn":

It's trivial:

1.Only include @2x images in your project.
2.Make sure those images have the @2x suffix. 
The system will automatically downscale for non-retina devices.

The only exception is if you are doing manual, low level Core Graphics drawing. 
You need to adjust the scale if so. 99.9% though, you don't have to worry about this.

From this post: Automatic resizing for 'non-retina' image versions

My question in regards to this is:

1. Should i do the testing on retina simulator only, as if i place a @2 grapic on 
non-retina it will be too big? ...or is there an other way of doing it?

2. Should i always use a ImageView or is it OK to drag the image on the screen, 
this is the logo i am talking about?

3. What about custom made buttons with images, how should i do with those?

4. What is the normal process to manage the different screen sizes, do people 
add images for all displays or using this type of process?

Solution

    1. Should i do the testing on retina simulator only, as if i place a @2 grapic on non-retina it will be too big? ...or is there an other way of doing it?

    It doesn't really matter which simulator you test on because as long as your non-retina and retina graphics are named correctly (image and image@2x) the correct image will be displayed automatically.

    1. Should i always use a ImageView or is it OK to drag the image on the screen, this is the logo i am talking about?

    When you drag and image from the project directly onto a view in interface builder you don't really see it happen but it has automatically created and image view which is containing the image your dropped in.

    1. What about custom made buttons with images, how should i do with those?
    [myButton setImage:[UIImage imageNamed:@"myFileName"]]; 
    

    As shown in the above code you should always use the non-retina fle name when you reference the image a UI element should use. That was if iOS detects the device is retina it can automatically use the @2x version in its place.

    1. What is the normal process to manage the different screen sizes, do people add images for all displays or using this type of process?

    Yes, including multiple image resolutions common practice and is required for iPhone apps (not sure about iPad) to include both retina and non-retina images. But regardless of the requirements, you should definitely support both device resolutions to keep your customers happy!