简体   繁体   English

获取iPhone 6和iPhone 6 plus的屏幕尺寸

[英]Getting the screen size of iPhone 6 and iPhone 6 plus

I have an application which is compatible with iPhone4 upto iPhone 6. For displaying the UI on multiple devices I am using: 我有一个与iPhone4到iPhone 6兼容的应用程序。为了在多个设备上显示UI,我正在使用:

CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;

and depending on the height and width returned, I am identifying the iPhone type and displaying a relevant image. 然后根据返回的高度和宽度,确定iPhone类型并显示相关图像。 The problem is when I run this code on the iPhone 6 or iPhone 6 Plus simulator it is still returning 568px as the screen height, the same as the iPhone 5. 问题是,当我在iPhone 6或iPhone 6 Plus 模拟器上运行此代码时,它仍返回568px作为屏幕高度,与iPhone 5相同。

How do I get the screen height of iPhone 6 and iPhone 6 Plus please? 如何获得iPhone 6和iPhone 6 Plus的屏幕高度?

Please create a XIB file named as LaunchScreen.xib. 请创建一个名为LaunchScreen.xib的XIB文件。 and set this as your launch screen file under "App icons and launch images" tab. 并将其设置为“应用程序图标和启动图像”标签下的启动屏幕文件。

Or you can simply add launch images for iPhone 6 and 6 Plus. 或者,您可以简单地为iPhone 6和6 Plus添加启动图像。 It will resolve your issue. 它将解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM