【发布时间】:2015-01-31 19:46:45
【问题描述】:
有很多关于 iPhone 6 和 iPhone 6 Plus 屏幕尺寸的文章和问题。 This article 提供了很好的解释。
但是,在模拟器中测试我的应用时,我感到很困惑。
我在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 模拟器中得到以下结果:
iPhone 4S:Screen width 320 px, height 480 px, scale 2.0x
iPhone 5:Screen width 320 px, height 568 px, scale 2.0x
iPhone 5S:Screen width 320 px, height 568 px, scale 2.0x
iPhone 6:Screen width 320 px, height 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。怎么了?
感谢您的解释。
【问题讨论】:
-
您可能忘记包含适用于 iPhone 6 和 6 Plus 的启动图像。因此,该应用程序只是基于 iPhone 5/5S 版本进行了升级,然后就是您在应用程序中“看到”的大小。
标签: ios objective-c ios-simulator iphone-6 iphone-6-plus