iPhone 5错误的屏幕高度 [英] iPhone 5 Wrong Screen Height

查看:53
本文介绍了iPhone 5错误的屏幕高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have developed an app on the 3.5 inch Screen and now I did a new Storyboard for the 4 inch screen and I do like follows to switch between storyboards on the appdelegate and I logged the screen height and it gives me 480.00000 check it:

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);
}

当我的手机是iPhone 5时,NSLog给我480.0000

The NSLog gives me 480.0000 while my phone is iPhone 5

推荐答案

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

You need to add a "tall" startup image Default-568h@2x.png to the app to indicate that you support the new display size, otherwise you'll be run in compatibility mode (and not full screen).

这篇关于iPhone 5错误的屏幕高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆