iOS UILaunchImageFile: some 4-inch-screen users see black borders

916 Views Asked by At

Some of my users seem to consistently see a clipped screen when running my app on their 4-inch devices. It may be limited to iPod Touch 5g users, and seems to occur on iOS6 and iOS7 (I am still investigating). I have what I think is a simple and correct UILaunchImageFile configuration, and it works fine on my iPhone 5 and in all the simulators. Any ideas?

Info.plist:

...
<key>UILaunchImageFile~ipad</key>
<string>UILaunchImage-iPad</string>
<key>UILaunchImageFile~iphone</key>
<string>UILaunchImage</string>
...

App product filesystem:

MyApp.app/
     ...
     Info.plist
     [email protected]    (640x1136)
     UILaunchImage-iPad.png       (768x1024)
     [email protected]    (1536x2048)
     UILaunchImage.png            (320x480)
     [email protected]         (640x960)
     ...

[EDIT: my startup code, in MyAppDelegate]

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    ...

    // screen.bounds is the whole display size;
    // screen.applicationFrame is smaller when you show the status bar
    UIScreen * screen = [UIScreen mainScreen];
    CGRect screenBounds = screen.bounds;
    CGRect applicationFrame = screen.applicationFrame;
    self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];

    // load main ui
    MyUIViewController * main = [[[MyUIViewController alloc] initWithNibName:@"MyUIViewController" bundle:nil] autorelease];
    UIView * rootView = [[[UIView alloc] initWithFrame:screenBounds] autorelease];
    main.view = rootView;
    [main loadIfNeeded];

    self.viewController = main;
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    ...
}
0

There are 0 best solutions below