Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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屏幕大小更改情节提要不起作用_Ios_Objective C_Iphone_Xcode - Fatal编程技术网

根据iOS屏幕大小更改情节提要不起作用

根据iOS屏幕大小更改情节提要不起作用,ios,objective-c,iphone,xcode,Ios,Objective C,Iphone,Xcode,我不太喜欢XCode 6的新约束系统,所以我决定为每个iPhone大小制作自己的故事板,但它不是100%有效。它适用于iPhone4和iPhone5,但在iPhone6或iPhone6+上测试时,它会显示iPhone5情节提要 示例:我使用iPhone4模拟器运行,故事板上的标签写着“4” 然后我运行iPhone5模拟器,故事板上的标签写着“5” 然后,我运行了iPhone6和6+模拟器,它显示了与iPhone5情节提要相同的标签,它显示了错误的情节提要 我想知道你们能不能告诉我出了什么问题,我

我不太喜欢XCode 6的新约束系统,所以我决定为每个iPhone大小制作自己的故事板,但它不是100%有效。它适用于iPhone4和iPhone5,但在iPhone6或iPhone6+上测试时,它会显示iPhone5情节提要

示例:我使用iPhone4模拟器运行,故事板上的标签写着“4”

然后我运行iPhone5模拟器,故事板上的标签写着“5”

然后,我运行了iPhone6和6+模拟器,它显示了与iPhone5情节提要相同的标签,它显示了错误的情节提要

我想知道你们能不能告诉我出了什么问题,我很感激

以下是我的故事板:

这是我的appdelegate.m文件中的代码

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

CGSize iOSScreenSize = [[UIScreen mainScreen] bounds].size;

if (iOSScreenSize.height == 480)
{
    // iPhone 4/4S
    UIStoryboard *iPhone4 = [UIStoryboard storyboardWithName:@"iPhone4" bundle:nil];

    UIViewController *initialViewController = [iPhone4 instantiateInitialViewController];

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

    self.window.rootViewController = initialViewController;

    [self.window makeKeyAndVisible];
}

if (iOSScreenSize.height == 568)
{
    // iPhone 5/5S
    UIStoryboard *iPhone5 = [UIStoryboard storyboardWithName:@"iPhone5" bundle:nil];

    UIViewController *initialViewController = [iPhone5 instantiateInitialViewController];

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

    self.window.rootViewController = initialViewController;

    [self.window makeKeyAndVisible];
}

if (iOSScreenSize.height == 667)
{
    // iPhone 6
    UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];

    UIViewController *initialViewController = [iPhone6 instantiateInitialViewController];

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

    self.window.rootViewController = initialViewController;

    [self.window makeKeyAndVisible];
}
if (iOSScreenSize.height == 736)
{
    // iPhone 6+
    UIStoryboard *iPhone6Plus = [UIStoryboard storyboardWithName:@"iPhone6+" bundle:nil];

    UIViewController *initialViewController = [iPhone6Plus instantiateInitialViewController];

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

    self.window.rootViewController = initialViewController;

    [self.window makeKeyAndVisible];
}

    return YES;
}

您是否为所有分辨率添加了正确的启动图像?我是否需要添加启动图像?当然。否则,您的应用程序将以旧分辨率在缩放模式下启动。啊,谢谢。现在我只需要找到应用程序图标,你知道我在哪里可以得到一些吗?当你调试和设置断点时会发生什么?它是否遵循正确的路径加载iPhone6和iPhone6+故事板?