How to Add iPhone 5 Large Screen Support to iOS Apps in Xcode

How to add iPhone 5 large screen support to iOS apps in Xcode?

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

iOS 6 apps - how to deal with iPhone 5 screen size?

All apps will continue to work in the vertically stretched screen from what I could tell in today's presentation. They will be letterboxed or basically the extra 88 points in height would simply be black.

If you only plan to support iOS 6+, then definitely consider using Auto Layout. It removes all fixed layout handling and instead uses constraints to lay things out. Nothing will be hard-coded, and your life will become a lot simpler.

However, if you have to support older iOS's, then it really depends on your application. A majority of applications that use a standard navigation bar, and/or tab bar, could simply expand the content in the middle to use up that extra points. Set the autoresizing mask of the center content to expand in both directions.

view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

It works great out of the box for table views, however, if your app used pixel-perfect layout for displaying content, then your best bet would be to re-imagine the content so that it can accommodate varying heights.

If that's not a possibility, then the only remaining option is to have two UIs (pre iPhone 5, and iPhone 5).

If that sounds ugly, then you could go with the default letterboxed model where the extra points/pixels just show up black.

Edit

To enable your apps to work with iPhone 5, you need to add a retina version of the launcher image. It should be named Default-568h@2x.png. And it has to be retina quality - there's no backward compatibility here :)

You could also select this image from within Xcode. Go to the target, and under the Summary section, look for Launch Images. The image has to be 640x1136 pixels in size. Here's a screenshot of where to find it, if that helps.

Xcode screenshot

How to develop or migrate apps for iPhone 5 screen resolution?


  1. Download and install latest version of Xcode.
  2. Set a Launch Screen File for your app (in the general tab of your target settings). This is how you get to use the full size of any screen, including iPad split view sizes in iOS 9.
  3. Test your app, and hopefully do nothing else, since everything should work magically if you had set auto resizing masks properly, or used Auto Layout.
  4. If you didn't, adjust your view layouts, preferably with Auto Layout.
  5. If there is something you have to do for the larger screens specifically, then it looks like you have to check height of [[UIScreen mainScreen] bounds] as there seems to be no specific API for that. As of iOS 8 there are also size classes that abstract screen sizes into regular or compact vertically and horizontally and are recommended way to adapt your UI.

How can I support the larger iPhone 5 screen with an older version of Xcode?

Add the new standard Default-568h@2x.png image to your main bundle and run your app on an iPhone 5. If it doesn't appear at the full resolution you may need need to upgrade your version of Xcode and compile the app against a newer iOS SDK. Xcode 3.2 has been deprecated for some time now.

Edit It appears that simply adding the Default-568h@2x launch image on an earlier SDK works as the OP mentioned. This is pretty handy to know.

As a side note, there is another answer on the new iPhone 5 launch image name

Extend app for iPhone 5 - best practice

Taking advantage of the full 4" screen in your apps seems to be as simple as adding a new Default image named Default-568h@2x.png with size 640 x 1136. Xcode 4.5 will actually offer to do this for you automatically by adding a black image of the proper size and name to your project.

For apps that use standard UI components, such as table views, the tables are magically extended to fill the screen. I updated an app for work and it was literally this simple, with only a couple minor issues related to my own code and UI setup. But all in all, very easy.

Contrast this with another app I work on (for myself), which uses none of the standard UI components except for UIViews. To deal with both 3.5" and 4" screens, I have had to spend quite a bit of time refactoring code that needs to know screen size for various operations of the app. (The app in this case is more of a game/simulator than say, a productivity app.)

So, your mileage may vary with regard to the level of effort really required to support the 4" screen. It will depend on how complicated and "non-standard" your app is, as I have discovered.

can I make my iOS app only available on iPhone 6 and later models?

In short, no you can't restrict certain screen resolutions.

Slightly longer version. Theoretically, it's possible to rule out iPhone 5S by adding a requirement of ARKit into Info.plist. But that will also get rid of 6 and 6+. And given that there's iPhone SE with an 1136 x 640 resolution, which supports ARKit, this is not an option either.

You could go even further and say that your app requires an NFC (which limits devices to iPhone 7(+)/8(+)/X), but then there are rumors of iPhone SE2, who knows if Apple is going to add an NFC chip to it (and it probably will).

Check out the device compatibility matrix.

How do I limit an iOS app only to 4 inch screen devices?


Nope.

Because iOS 7 supports devices with 3.5" screens, you can't use the only-support-iOS-x technique.

Also, there isn't a setting in Xcode or a key for requiredDeviceCapabilities which allows you to make the app 4-inch only.

Unable to start my application in full screen on iPhone 6.0 Simulator Retina 4 Inch

Make sure that key window has proper size. Workaround is to set proper frame: [window setFrame:[[UIScreen mainScreen] bounds]].

Update:

It is difficult to guess where is the problem without having the source code.
I've created simple app stub to test interface orientation for iPhone4/iPhone5. I just created new "Single View Application", added some subviews to the root view, and added "Defaults" images. I did it in Xcode 4.3.2 without any extra features of Xcode 4.5. And app automatically stretches its screen to proper size (for both portrait/landscape orientations).



Related Topics



Leave a reply



Submit