20

There were many articles written and questions asked about iPhone 6 and iPhone 6 Plus screen sizes. This article provides a great explanation.

However, I am confused when testing my app in the simulator. I have the following code in AppDelegate.

- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
    UIScreen *screen = [UIScreen mainScreen];
    NSLog(@"Screen width %.0f px, height %.0f px, scale %.1fx",
          (double) screen.bounds.size.width,
          (double) screen.bounds.size.height,
          (double) screen.scale);

    return YES;
}

I get the following results from iOS simulator for various devices:

iPhone 4S: Screen width 320 px, height 480 px, scale 2.0x

iPhone 5: Screen width 320 px, height 568 px, scale 2.0x

iPhone 5S: Screen width 320 px, height 568 px, scale 2.0x

iPhone 6: Screen width 320 px, height 568 px, scale 2.0x

iPhone 6 Plus: Screen width 320 px, height 568 px, scale 2.0x

The results are fine for iPhone 4S, iPhone 5 and iPhone 5S. However, I expect larger screen size for iPhone 6 and iPhone 6 Plus and I also expect scale 3.0 for iPhone 6 Plus. What is wrong?

Thanks for explanation.

Cimlman
  • 3,404
  • 5
  • 25
  • 35
  • 6
    You probably forgot to include appropriate launch images for the iPhone 6 and 6 Plus. Therefore the app is simply upscaled based on the iPhone 5/5S version, which is then the size you "see" in your app. – rdurand Dec 03 '14 at 09:58

5 Answers5

32

It seems like you didn't provide correct launch images to your app. When there is no correct launch images set, the app will run like on iPhone 5/5S, that's why you are having these confusing results while logging. iPhone 6 screen size is 375x667 px scale x2, iPhone 6+ 414x736 px scale x3. So, if you want to set launch image for iPhone 6 it should have 750x1334 px size, and 1242x2208 for iPhone 6+ respectively. Good Luck!

EDIT:

As rmaddy mentioned in the comments, it's better to use launch screen storyboard with proper layout constraints to fit all screens, than having bunch of images for all screens(which also increases the app size).

Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29
  • Want to add a link for [update info](https://stackoverflow.com/questions/27268470/iphone-6-plus-screen-size/27268653#27268653) – Mathi Arasan Jun 06 '17 at 07:24
  • 1
    Instead of using all of the different launch images, just use one launch screen storyboard. – rmaddy Feb 22 '18 at 16:44
  • launch screen picks the wrong image fine for iphone x, and I tired but couldnt choose device specific images for launch screen. it was always choosing the wrong one. – Reza.Ab Feb 22 '18 at 16:56
8

You have to add Launch Image in Imageasset for iPhone 6 and 6+ with proper resolution.

if you dont know resolution please check right side navigator > choose 3rd option. right now in screenshot you can see Expected size 1242x2208 pixel

please check attached screenshot. once you add this all images then only you will get proper.

for iPhone 6 it will log

Screen width 375 px, height 667 px, scale 2.0x

for 6+

Screen width 414 px, height 736 px, scale 3.0x

enter image description here

ChintaN -Maddy- Ramani
  • 5,156
  • 1
  • 27
  • 48
3

Add a Launch Screen to your project, ->File -> New File -> in iOS User Interface -> Launch screen. Then in the General View of your App, select the LaunchScreen.xib in the Launch Screen File field. Try again your code, and you could see the real sizes.

Malloc
  • 15,434
  • 34
  • 105
  • 192
Onik IV
  • 5,007
  • 2
  • 18
  • 23
1

In my case, I found the settings in iPhone about the display. (Settings - Display & Brightness - DISPLAY ZOOM).

If your setting is "Zoomed", screen width will be 320px.

손정환
  • 11
  • 1
  • It did not make sense why my iPhone 6s was reporting 320 x 568 but the simulator for iPhone 6s was fine. It was this setting making a huge difference. I was already using the launch screen storyboard. – Jeff Muir Sep 30 '19 at 04:25
0

For others who may come into the question:

Make sure your launch image names are not the same with any other pictures in your project, otherwise Xcode may be confused and also returns iPhone 5 width and height.

Jenny Cheung
  • 301
  • 2
  • 5
  • 12