Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS UILaunchImageFile:一些4英寸屏幕用户看到黑色边框_Ios_Ipod Touch_Uilaunchimagefile - Fatal编程技术网

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

iOS UILaunchImageFile:一些4英寸屏幕用户看到黑色边框,ios,ipod-touch,uilaunchimagefile,Ios,Ipod Touch,Uilaunchimagefile,我的一些用户在他们的4英寸设备上运行我的应用程序时,似乎总是看到一个裁剪过的屏幕。这可能仅限于iPodtouch5G用户,而且似乎发生在iOS6和iOS7上(我仍在调查)。我有一个简单而正确的UILaunchImageFile配置,它可以在我的iPhone 5和所有模拟器上正常工作。有什么想法吗 Info.plist: ... <key>UILaunchImageFile~ipad</key> <string>UILaunchImage-iPad</st

我的一些用户在他们的4英寸设备上运行我的应用程序时,似乎总是看到一个裁剪过的屏幕。这可能仅限于iPodtouch5G用户,而且似乎发生在iOS6和iOS7上(我仍在调查)。我有一个简单而正确的UILaunchImageFile配置,它可以在我的iPhone 5和所有模拟器上正常工作。有什么想法吗

Info.plist:

...
<key>UILaunchImageFile~ipad</key>
<string>UILaunchImage-iPad</string>
<key>UILaunchImageFile~iphone</key>
<string>UILaunchImage</string>
...
[编辑:我的启动代码,在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];

    ...
}

将所有viewcontrollers模拟器指标设置为4英寸屏幕,我希望这能起作用…我认为您必须调整窗口大小。。。您可以按照链接调整窗口大小:-@Bhrigesh,该链接用于编程MacOS X,而不是iOS。@Bhrigesh,我不使用模拟度量,而是自己设置视图的框架。我通过传入[[UIScreen mainScreen]边界]在代码中创建自己的窗口——代码现在包括在内。
- (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];

    ...
}