Search code examples
iphoneios-simulatoriphone-5

Convert iphone 4 app into iphone 5


We have update our application to support both iPhone 4 and iPhone 5 screen size. It is working fine in both simulators but when we install it on iPhone 5 device then it behaves like iphone 4 application (Black borders on top and bottom). We have also added [email protected] bot not working correctly. We are creating window dynamically.

What we are missing here ? Any ideas ?

Also how to set "Full Screen At Launch" property of UIWindow programmatically ?


Solution

  • Here is one solution that worked

    A. In your AppDelegate.m initialize the UIWindow object like this

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]
    

    B. In order to manage other UI Elements You can define a macro that provides current frame of the screen be it iPhone 4/iPhone 5

    #define SCREEN_FRAME [[UIScreen mainScreen] applicationFrame]
    

    Accordingly you can use SCREEN_FRAME width/height properties to adjust other UI elements

    Hope this helps.