Search code examples
iphonexcoderetina-display

how to migrate iOs 5 App to new 4" retina display?


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

We have an iOS 5 app which uses 3,5" retina display. I read that in iPhone 5 4" retina display, the app is shown in center of screen, by adding two black bars, one on top and another on bottom of screen. In my case and using Xcode emulator these bars don't display. The app is shown using whole screen like this:

Huge screenshot

What is the problem? How to solve this situation?


Solution

  • The layout will follow the way the resize and pinning struts are set for each of the views. The tab bar is pinned to the bottom of the screen, which is why it is there. I'm not sure what you have going on that is making the background duplicate a portion of itself like that.

    But in Interface Builder, you can click the button in the lower right corner to toggle between the older iPhone 3.5" and iPhone 5 4" screen sizes and see how your views adjust their layout on each screen. Ideally, you will want to rework your app so that the background assets can fill the full 4" screen and simply crop off the bottom portion on the older screens.

    Similarly, the controls and subviews should have their autosizing resize and pinning struts set in the size inspector so that they will stretch or reposition properly on both screens. Views like UITableView and UIScrollView are easily stretched to fill the additional screen. Other views such as buttons and text fields usually remain static in their sizes and positions relative to either the top or the bottom.