【问题标题】:iPhone 5 Wrong Screen HeightiPhone 5 屏幕高度错误
【发布时间】:2012-12-26 08:45:41
【问题描述】:

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

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

【问题讨论】:

  • 你有 568px 高的启动图片(Default.png)吗?否则,您将不会以全屏模式启动。
  • 我现在就试试。并回复你。感谢您的帮助:D
  • 感谢它的工作:D +1

标签: ios ios5


【解决方案1】:

您需要在应用程序中添加一个“高”的启动图像Default-568h@2x.png,以表明您支持新的显示尺寸,否则您将在兼容模式下运行(而不是全屏)。

【讨论】:

    【解决方案2】:

    您应该在项目中添加一个新的默认图像Default-568h@2x.png

    【讨论】:

      【解决方案3】:

      很简单,只需将iPhone 5的默认图片Default-568h@2x.png添加到项目中即可。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-06-28
        • 1970-01-01
        • 1970-01-01
        • 2016-06-21
        • 1970-01-01
        • 2012-11-27
        • 1970-01-01
        相关资源
        最近更新 更多