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?

Community
  • 1
  • 1
Anton
  • 5,932
  • 5
  • 36
  • 51

3 Answers3

71

Add a new launch image named Default-568h@2x.png to your project and it will work!

Ben Trengrove
  • 8,191
  • 3
  • 40
  • 58
Luca T
  • 1,203
  • 1
  • 10
  • 9
  • it's working but how to set the interfaceOrientation for that,any idea? – Dhaval Sep 13 '12 at 10:29
  • 5
    For completeness, let's mention that Default-568h@2x.png should be a 640 x 1136 pixel image. – Joe Strout Sep 04 '13 at 00:18
  • _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](http://stackoverflow.com/questions/12596991/missing-retina-4-launch-image-how-to-ignore-this-error/20873035#20873035)) – bobobobo Jan 02 '14 at 01:15
  • 2
    ***Silly Apple & Crazy Developers...*** **No one can dream that this is solution for that...** – Fahim Parkar Sep 18 '14 at 09:59
  • 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... – bk138 Mar 13 '15 at 15:25
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 "Default-568h@2x.png" 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.

AliSoftware
  • 32,623
  • 6
  • 82
  • 77
  • 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. – Jann Sep 13 '12 at 16:46
  • 5
    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. – Steve Sep 25 '12 at 21:32
  • Autolayout won't be supported on iOS5 an below. – Kassem Oct 23 '12 at 06:39
  • @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. – AliSoftware Oct 23 '12 at 09:22
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.

RelativeGames
  • 1,593
  • 2
  • 18
  • 27