I have an application in iphone in which i am using most of the static images in the background as an image in the background image it self.Means a single background image including all the staic things.now i want to migrate to iphone 5 also.Now i am using an image of 640*960 as the background image.if i change that to 640*1136 then when it used in 4serieses of iphone the image will shrink i think.Let it i am fixing the frame size by checking the screeen.Can anybody help me how i can resolve this issue?
2 Answers
To know, what kind of image You should use (for iPad 768x1024, for iPhone 320x480, etc..) You can detect device, and then set corresponding image.
You can distinguish between iPad/Retina/iPhone using this SO article:
Detect retina screen/iPhone 4 in iPhone SDK
You can detect iPhone 5 using example in this SO article:
How to detect iPhone 5 (widescreen devices)?
If you have only portrait supported, You can check using this simple method:
if([[UIScreen mainScreen] bounds].size.height == 480)
{
//iPhone, iPhone retina
}
else if([[UIScreen mainScreen] bounds].size.height == 1024)
{
//iPad, iPad retina
}
else //568 height
{
//iPhone 5
}
And of course - as Valeriy Van mentioned, You need Default-568h@2x.png image added to your bundle.

- 1
- 1

- 4,764
- 2
- 50
- 72
There is no connection between image resolution and size of UIImageView. Image will be rescaled or positioned inside view bounds depending on contentMode property.
What you need first - add Default-568h@2x.png image of 640x1136 as Launch Image for Retina 4 inch. If springs and struts of your views are set right, everything will work as granted.

- 1,851
- 16
- 19
-
i didnt get u?springs and sports means? – hacker Sep 26 '12 at 08:04
-
It is about autoresizingMask property. They work like springs and struts and in Interface builder look similar. – Valeriy Van Sep 26 '12 at 08:10
-
i sd if i set a frame size according to (320 ,480) with an image with a reselution 1136*640 it will shrinked?right? – hacker Sep 26 '12 at 08:42
-
It depends on contentMode property. In most cases yes, it will be rescaled. – Valeriy Van Sep 26 '12 at 09:34