iOS UILaunchImageFile:一些4英寸屏幕用户看到黑色边框

时间:2013-10-04 06:47:00

标签: ios ipod-touch uilaunchimagefile

在我们的4英寸设备上运行我的应用时,我的一些用户似乎始终看到剪裁的屏幕。它可能仅限于iPod Touch 5g用户,似乎发生在iOS6和iOS7上(我还在调查)。我认为是一个简单而正确的UILaunchImageFile配置,它在我的iPhone 5和所有模拟器中都能正常工作。有什么想法吗?

的Info.plist:

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

应用产品文件系统:

MyApp.app/
     ...
     Info.plist
     UILaunchImage-568h@2x.png    (640x1136)
     UILaunchImage-iPad.png       (768x1024)
     UILaunchImage-iPad@2x.png    (1536x2048)
     UILaunchImage.png            (320x480)
     UILaunchImage@2x.png         (640x960)
     ...

[编辑:我的启动代码,在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 个答案:

没有答案