Reputation: 15
I am completely new to iOS i am developing an app which is compatible with iPhone 5 also i want to apply background image to view my question is that should i need two different images of both sizes????
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone 4S background view
}
if(result.height == 568)
{
// iPhone background image
}
}
Upvotes: 0
Views: 680
Reputation: 27050
Say you've background.png for app background, now to support retina devices you should have an exact double size of background.png that will be added as [email protected] in your project folder. The selection of normal or retina image will be handled by iOS itself based on which device you've!
Okay, now for iPhone 5 device which height is not equivalent to iPhone 3G, 4, 4S you need background.png of 640(width)*1136(height), as iPhone 5 only supports retina images. For that you need to include [email protected]
to differentiate it from other files.
An example of splash screen,
Default.png --- Normal devices, iPhone 3G
[email protected] --- Retina devices, > iPhone 3G
[email protected] --- Retina devices only, > iPhone 4S
It will select specific splash screen automatically!
Upvotes: 3