简体   繁体   中英

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:

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. 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.

How do I get the screen height of iPhone 6 and iPhone 6 Plus please?

Please create a XIB file named as LaunchScreen.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. It will resolve your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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