iPhone 5错误的屏幕高度

The*_*her 3 ios ios5

我在3.5英寸屏幕上开发了一个应用程序,现在我为4英寸屏幕做了一个新的故事板,我喜欢跟随在appdelegate上的故事板之间切换,我记录了屏幕高度,它给了我480.00000检查它:

NSLog(@"Checking Screen Size");
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
{    
    NSLog(@"On iPhone");
    CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;

    if (iOSDeviceScreenSize.height == 480)
    {   (diagonally measured)
        NSLog(@"iPhone 4: %f", iOSDeviceScreenSize.height);
}
if (iOSDeviceScreenSize.height == 568)
{   
        NSLog(@"iPhone 5: %f", iOSDeviceScreenSize.height);
}
Run Code Online (Sandbox Code Playgroud)

我的手机是iPhone 5,NSLog给了我480.0000

Thi*_*ilo 6

您需要向Default-568h@2x.png应用程序添加"高"启动图像以指示您支持新的显示大小,否则您将以兼容模式运行(而不是全屏).