How to add iPhone 5 large screen support to iOS apps in Xcode? [duplicate]
Asked Answered
L

3

28

Possible Duplicate:
How to deal with iPhone 5 screen size?

How can I add support for 4-inch iPhone 5 displays to an iOS app in Xcode?

Is this even possible with the latest public Xcode release, v4.4.1?

Lieberman answered 12/9, 2012 at 21:1 Comment(0)
A
71

Add a new launch image named [email protected] to your project and it will work!

Ardent answered 12/9, 2012 at 22:40 Comment(5)
it's working but how to set the interfaceOrientation for that,any idea?Apul
For completeness, let's mention that [email protected] should be a 640 x 1136 pixel image.Fca
Yes, yes, yes, yes. You must have this image, or your app won't be considered iPhone 5 compatible (it will not pass App store validation either)Coxcomb
Silly Apple & Crazy Developers... No one can dream that this is solution for that...Katlin
The Retina4 launch image needs to be exactly 640 x 1136, otherwise validation after archiving will fail. Name does not matter, at least with XCode 6 and xcassets...Instancy
T
4

If your application is iOS6 only, the easiest way to make views that layout correctly in both 3.5-inch and 4-inch iPhone 5 designs is to use AutoLayout in your XIBs to make them adapt their size automatically (See the WWDC'2012 video sessions about that). If your application must support versions prior to iOS6, then you can still use AutoResizingMasks on your views to make them resize themselves to adapt to both 3.5 and 4 inch screens.

Then for your application to support the 4-inch display and take the whole screen when launched on an iPhone 5, simply add a "[email protected]" launch image to your project. The simple presence of this launch image will make your application launch full-screen on iPhone 5 instead of having black bands at the top and bottom.

Timmerman answered 12/9, 2012 at 21:6 Comment(4)
This is not an answer. AutoLayout does NOT cover most issues that one needs to target a different screen. Apple would love it if it did, however, most designers want to specify where things go, not where things go in relation to other things.Aurify
This is also not an option if you want your app to support anything older than iOS 6, which most apps do. If you turn on Autolayout in any Xib file it will fail to compile against the older Base SDK.Phosphocreatine
Autolayout won't be supported on iOS5 an below.Lamination
@KassemBagher I never said it would, and that's why I mentioned in my answer that this is a feature avail in iOS6 — so it can be useful if the OP were designing an iOS6-only application. The OP didn't mention anything about retrocompatibility in his question first (iOS6 is already widely adopted thanks to OTA updates, so most devs don't support iOS4 & iOS5 anymore for new projects). If you need to support iOS5, you can still use AutoResizingMasks.Timmerman
H
3

Short answer : use the new launch image slot ( the Retina 4-inch ) one in XCode->Targets->Summary->iPhone/iPod Deployment Info

I have an OpenGL ES 2 app that despite all options I checked, nothing worked. Creating a new GLGame project adds black launch images for Retina 3.5 inch and Retina 4 inch. Despite every other comparison to project settings or .plist file I found nothing else to say "make it available for iPhone 5". I sure hope this changes in the future.

Hippopotamus answered 12/9, 2012 at 22:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.