GetCurrentDisplayMode on iPhone 6/6s/7 returns 960x640


#1

Hello,

I am trying to get the display mode for iPhone 6/6s/7 with GetCurrentDisplayMode or with GetDisplayMode, and the biggest display mode I can get is 960x640.

What is going wrong?


#2

Paging @slime, does Maarten need some Info.plist entry or something to enable native resolution? Or is this not counting space used by the status bar, or…?


#3

Apple only exposes the native resolution to apps if the app has a launch screen (nib/xib/storyboard file) or properly sized launch images:

https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
https://useyourloaf.com/blog/using-a-launch-screen-storyboard/


#4

@icculus @slime hey guys! Thanks fro the fast reply, I am not sure if I am setting the a launch Image right or the info.list so I will try those! thanks again!


#5

If you want to use launch images instead of the newer Launch Screen, you’ll need to have an Images.xcassets which contains multiple launch images - one for each resolution that modern iOS devices have. https://medium.com/@jigarm/ios-app-icon-and-launch-image-sizes-e8d5990cb72b


#6

@slime Thanks I do actually want Launch Image and not the screen, I will be looking into it.
Thanks again!


#7

Hi,

try this : hopefully your code is objective-C compliant…
#import <UIKit/UIKit.h>

CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
CGFloat screenHeight = screenSize.height;

#8

Thanks, actually setting a Launch screen, or a Launch Image seams to fix the problem.