2

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

信息列表:

...
<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];

    ...
}
4

0 回答 0