0

I run my app on my iPhone 7 + device and when I try to log the Scale and screen bound sizes, What I get is related to iPhone 5/5s/5c/SE, NOT to my iphone 7 plus specification. This is what I get in log:

CGFloaf scale = [[UIScreen mainScreen] scale];
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;

NSLog (@"Scale: %f", scale);
NSLog (@"screenHeight: %f", screenHeight);

Output :
Scale: 2.000000
screenHeight: 568.000000

Why is that??! I appreciate any help.

Reza.Ab
  • 1,195
  • 1
  • 11
  • 21
  • what version of the SDK and Xcode are you using? – Grady Player Feb 22 '18 at 16:41
  • 2
    Because you don't have a proper launch screen or you don't have the proper launch images. – rmaddy Feb 22 '18 at 16:41
  • My launch images have the right pixel size and also as file name, I tried both `Default-414w-736h@3x~iphone.png` and `Default-736h@3x.png` but still it doesn't work. I use XCode 9.2 – Reza.Ab Feb 22 '18 at 16:50
  • Im affraid I would probably have the same problem with iphone X as well. Could you suggest me the correct names for launch images so I can assure it will detect Plus size devices as well as iPhone x correctly? I appreciate it. – Reza.Ab Feb 22 '18 at 16:51
  • Also all devices including iPads and normal sized iphones are working correctly, These are the names I have for my launch images for each device: Default-568h@2x.jpeg Default-667h@2x.png Default-736h@3x.png Default-812h@3x.png Default-Portrait@1x.jpeg Default-Portrait@2x.jpeg – Reza.Ab Feb 22 '18 at 16:53
  • 1
    @Reza.Ab You don't need any special filenames for the launch images. As long as you are properly using a launch image set in Xcode, the filenames are irrelevant. – rmaddy Feb 22 '18 at 16:57
  • I am already using launch image set and all sizes are correct! @rmaddy – Reza.Ab Feb 22 '18 at 17:12
  • Apparently not. Show some screenshots from Xcode showing that your launch images are setup correctly. – rmaddy Feb 22 '18 at 17:14
  • here is a picture @rmaddy https://imgur.com/a/j1cYC – Reza.Ab Feb 22 '18 at 17:51
  • go to interface builder click on you vc click and drag your view to your vc give equal height and width. i hope it may be help –  Feb 23 '18 at 04:46
  • @JRB omg are you being serious? – Reza.Ab Feb 23 '18 at 04:56
  • @Reza.Ab whats wrong Buddy? –  Feb 23 '18 at 05:24
  • @JRB of course Ive done all sort of stuff with launch screen and set constraints and stuff but if i wanted to so that i wouldn't use Launch image set. I don't want to use Launch screen xib because putting an imageview in it won't detect Launch images for iPhone x. So that's pointless – Reza.Ab Feb 23 '18 at 11:36

0 Answers0