Convert iPhone app to universal binary (part II) - iphone

I have adjusted my target to be universal. Now the images look scaled up. Do I have to have every image twice, in different resolutions?
What's the correct way to do this? Or do I make images in iPad resolution and use them on the Phone as well?
And: if I do have to duplicate every image, is there a convention such as having the img.png for the iPhone in the Resources folder and the img.png for the Pad in the Resources-iPad folder?
Many thanks for your help!!

No I just suggest having them in one resolution (iPad) and they will scale down.
Actually I suggest making all graphics Retina compatible and then they will look fine on the iPad.

The best, and well the correct way to do this is to have 3 of every image
320x480 Default.png for iPhone
640x960 Default#2x.png for iPhone 4
and for iPad 768x1024 iPad Default Image sizes
But if your trying to keep your app as small in size as possible then making the images in retina resolution would be the best way to achieve this. The difference on iPad if scaled correctly wouldn't be noticed. Just be sure not to title the retina images with the "#2x" suffix and scale to fill on low resolution for low resolution iPone interfaces.

Related

Suffix for Retina Images in iPhone 5

I have some image files for iPhone 5 size 640x1136, i have previously implemented retina images for iPhone 4 & 4S using #2x suffix, so what will be the suffix for images in iPhone 5, we can user the same as is #2x or it has to be changed.
It’ll still use #2x images where they’re available. There’s a -568h suffix you can use for the launch image, as in Default-568h#2x.png, but that’s currently the only place it’s supported; see Leo’s answer for a way to get that working elsewhere.
See my answer here. Some useful macros to help you with dealing with images.
For the iPhone Retina 4-inch (iPhone 5) it's still the #2x suffix because the density is the same as the iPhone Retina (iPhone 4 and 4S). The screen is bigger but have the same density.
The -568h suffix will work only in for the default image because it's the only place you really need it (just to tell the system that your app have been optimized for this new screen size, and it can stretch your views).
The naming convention Default-xxx.png is just here to provide the right image while the app is launching but I think it's non sense to try to replicate the same to load other images in imageViews. It's like the Default-(landscape|portrait).png on iPad. You never need this convention to load images yourself.
The only rule is:
# is for density (2 density exist right now, normal and 2x)
~ is for device (2 different devices exist right now, iphone and ipad)
To adapt images/imageView on the 4-inch iPhone you should play with your imageView content mode and the autoresizing configurations.

What size images should I use in order to support the two iphone resolutions?

I have a few questions about screen resolution, that I'm not clear on. These questions assume they my app will be running on iOS 4.0 and up, and on either iPhone 3GS or iPhone 4.
Should the size of the splash image (default.png) be (960x640) or (480x320)?
Should the size of the app icon (Icon.png) be (57x57) or (114x114)?
What about other graphics that I may use in my app, such a graphic that represents a button? Should I always create these images for the higher resolution, and have the app scale them down? In other words, if I want a button image to be displayed on the 3GS that is 200x40 - should I create the image at 400x80, so that iPhone 4 can take advantage of it?
Thanks!
A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with #2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called image#2x.png at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.
Provide both sizes (960x640 & 480x320) for the splash image using the #2x method described above
Provide both icons (57x57 & 114x114) using the #2x method
For our apps we use a combination of the #2x images and just Scaling the large images. (More information on this can be found in the above article) We use the #2x images for bar buttons, icons, etc. But for UIImageViews we often just use the Scaling. 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.
Related Questions:
Retina/non-retina images in UIImageView
Making an app Retina Display friendly
You need to provide both if you want them to look nice. For example,
Default.png -> (480x320)
Amd
Default#2x.png -> (960x640)

Making an app Retina Display friendly

I have an app and would like to make it retina display friendly.
How exactly does the process work? What images need to be added apart from what I have?
I know the sizes should be different, but am not sure on the details?
What else needs to be done to handle retina display?
Should the device be detected and use other images if the device supports retina display?
What if there are a lot of images? And how will this effect the app size?
Thanks
A good guide to this can be found here: http://mobile.tutsplus.com/tutorials/iphone/preparing-your-iphone-app-for-higher-resolutions/
In general you just create 2 sets of images. Your original and then a new one twice as big with #2x in the name. So for image.png at size 32x32 you would have one that is twice the resolution called image#2x.png at size 64x64. In your app just always use the image.png in Interface Builder and when loading in code.
There is no need to detect the device. These images will automatically be picked up by the OS and subbed in as necessary.
good articles if you're using sprites
http://weedygarden.net/2012/04/hi-res-retina-display-css-sprites/
The main thing about working with retina image is that image name convention.
And the size of image should be 2times greater than regular1.
Example- if your icon name for regular is icon.png then it should be icon#2x.png for
retina.And second thing is size for regular is 72*72 then it should be 144*144 for Retina.
It might be helpful for you.
Thnks

High Resolution iPhone Background

According to Apple's website, the iPhone 4 is 960-by-640-pixel resolution at 326 ppi. I made an image with these specs, however when I put it onto my iPhone as a background for one of my applications, it is way too big and you can only see the upper left corner of the image. How do I make it fit and how do I make a high resolution iPhone 4 background?
You need to give it the name "someImage#2x.png" with the important part being #2x so they can apply the scale correctly.
Realize though that you also need "someImage.png" which is half that size for devices without the retina display.
I always use the "someImage.png" file as the initial image and then the OS will automagically switch to the #2x image during runtime so don't worry about that. Just set it to the standard 320x480 or 480x320 and let the OS do the rest.
Are you using an UIImageView? You should have two versions of your images
image.png - normal 320x480 image for older phones
image#2x.png - for iphone4 with the 640x960 resolution
When you set the file location (be it programically or in Interface Builder) just tell it about the 'image.png'. The iPhone4 will automatically look for the '#2x' version.

retina display graphics on the iPad not showing up - why?

I've installed my iPhone app on an iPad. When I tap this "2x" button, the app gets scaled up, but it doesn't use my retina display graphics. Isn't that somewhat stupid? I am sure I did something wrong!
What must I set in the info.plist or elsewhere that the iPad will use my retina display graphics when the app is watched in 2x mode?
No, it literally just scales up the screen. It may be a bit lame but that's by design. Note that even the text is pixel-doubled.
If you want to make better use of the screen you have to make a "Universal" app.
If you use a hi-res image (not called #2x) in your app, then size the UIImageView half the size of the image it will appear crisp on the iPhone, retina, and iPad scaled up.
Please make sure your retina image naming convention is correct.
For retina image naming convention should be #2x.Suppose if your regular image name is like
icon.png then for retina it should be icon#2x.png.