Screen size is wrong on iPhone 6 / iOS 8.3?

I just came across something very strange and perplexing.

I have a code in a client application that loads different images based on the screen size.

I have some code that uses the current screen to determine the screen size.

On my iPhone 6 (the actual device, not the simulator) it shows a screen size of 320x568, which is the screen size of the iPhone 5.

If I run the exact same code on the iPhone 6 sim, the screen size is reported correctly at 375x667.

To remove all extraneous details, I just created a new project with a single Xcode view project template. I used Objective-C in case it was a Swift issue. I added the viewWillAppear: method to the view controller that Xcode creates, which looks like this:

- (void) viewWillAppear:(BOOL)animated
{
  [super viewWillAppear:animated];
  UIScreen *screen = [UIScreen mainScreen];
  CGSize screenSize = screen.bounds.size;
  _label.text =[NSString stringWithFormat:
                @"Screen size = %@",
                NSStringFromCGSize(screenSize)];
}

      

The Xcode template application has the info.plist "UILaunchStoryboardName" set to "LaunchScreen", which actually refers to a XIB file called "LaunchScreen.xib". XIB displays during startup on all devices. However, the screen size reported on the iPhone 6 is incorrect.

What am I missing?!?

+3


source to share


2 answers


I am assuming that your iPhone 6 is in zoomed mode as described here:

https://support.apple.com/en-us/HT203073



In this mode, the iPhone 6 effectively thinks it is the iPhone 5 for display purposes (and conveys an iPhone 5-sized screen environment for all apps).

+3


source


You need to add the iPhone 6 splash screen to your project



+1


source







All Articles