iPhone 6(Plus)屏幕尺寸 [英] iPhone 6 (Plus) screen size

查看:169
本文介绍了iPhone 6(Plus)屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多文章和有关iPhone 6和iPhone 6 Plus屏幕尺寸的问题。 这篇文章提供了很好的解释。

There were many articles written and questions asked about iPhone 6 and iPhone 6 Plus screen sizes. This article provides a great explanation.

然而,在模拟器中测试我的应用程序时我很困惑。
我在 AppDelegate 中有以下代码。

However, I am confused when testing my app in the simulator. I have the following code in AppDelegate.

- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
    UIScreen *screen = [UIScreen mainScreen];
    NSLog(@"Screen width %.0f px, height %.0f px, scale %.1fx",
          (double) screen.bounds.size.width,
          (double) screen.bounds.size.height,
          (double) screen.scale);

    return YES;
}

我从iOS模拟器获取以下各种设备的结果:

I get the following results from iOS simulator for various devices:

iPhone 4S:屏幕宽度320像素,高度480像素,比例2.0x

iPhone 4S: Screen width 320 px, height 480 px, scale 2.0x

iPhone 5:屏幕宽度320像素,高度568像素,比例2.0x

iPhone 5: Screen width 320 px, height 568 px, scale 2.0x

iPhone 5S: 屏幕宽度320像素,高度568像素,比例2.0x

iPhone 5S: Screen width 320 px, height 568 px, scale 2.0x

iPhone 6:屏幕宽度320像素,高度568像素,比例2.0x

iPhone 6: Screen width 320 px, height 568 px, scale 2.0x

iPhone 6 Plus:屏幕宽度320像素,高度568 px,scale 2.0x

iPhone 6 Plus: Screen width 320 px, height 568 px, scale 2.0x

结果适用于iPhone 4S,iPhone 5和iPhone 5S。但是,我预计iPhone 6和iPhone 6 Plus的屏幕尺寸会更大,我也希望iPhone 6 Plus的尺寸为3.0。有什么问题?

The results are fine for iPhone 4S, iPhone 5 and iPhone 5S. However, I expect larger screen size for iPhone 6 and iPhone 6 Plus and I also expect scale 3.0 for iPhone 6 Plus. What is wrong?

感谢您的解释。

推荐答案

似乎就像你没有为你的应用程序提供正确的启动图像。如果没有正确的启动图像设置,该应用程序将像iPhone 5 / 5S一样运行,这就是为什么您在记录时遇到这些令人困惑的结果。 iPhone 6屏幕尺寸为375x667像素刻度x2,iPhone 6 + 414x736像素刻度x3。因此,如果你想为iPhone 6设置启动图像,它应该分别为750x1334像素大小和1242x2208分别用于iPhone 6+。祝你好运!

It seems like you didn't provide correct launch images to your app. When there is no correct launch images set, the app will run like on iPhone 5/5S, that's why you are having these confusing results while logging. iPhone 6 screen size is 375x667 px scale x2, iPhone 6+ 414x736 px scale x3. So, if you want to set launch image for iPhone 6 it should have 750x1334 px size, and 1242x2208 for iPhone 6+ respectively. Good Luck!

编辑:

正如rmaddy在评论中提到的,它是最好使用具有适当布局约束的启动屏幕故事板以适应所有屏幕,而不是为所有屏幕提供大量图像(这也会增加应用程序大小)。

As rmaddy mentioned in the comments, it's better to use launch screen storyboard with proper layout constraints to fit all screens, than having bunch of images for all screens(which also increases the app size).

这篇关于iPhone 6(Plus)屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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