18

I'm using the new Xcode 6 GM Seed and testing my app on the iPhone 6 and iPhone 6 Plus simulators. I'm getting a strange effect on some projects I was previously working on, namely that the views seem to be getting a "zoom in" effect.

Here's an example. Both these view controller's are exactly the same (minus the different navigation item text), down to the label text size. However, you can see that the views appear different.

zoomed

normal

Note that the project with the weird zoom effect has a deployment target of 8.0.

Note: I got the normal looking one to work by making the project in the new Xcode 6 GM Seed (the projects that aren't working were made on older versions of Xcode).

arcticmatt
  • 1,956
  • 1
  • 19
  • 36

6 Answers6

22

This is the default and this is how all existing apps will work on the new iPhones - they will be "zoomed".

To make an app that actually uses the extra screen size you must, like with the 4" iPhones, add specific launch images specific to the two iPhone 6's.

If you are using asset catalogs, go to the LaunchImages asset catalog and add the new launch images for the two new iPhones. You may need to right-click and choose "Add New Launch Image" to see a place to add the new images.

In addition, using a Launch Screen xib file instead of images solves this problem right away and it's the recommended way moving forward. Here are the steps to add a Launch Screen to your app: https://stackoverflow.com/a/25763870/422288

Community
  • 1
  • 1
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • I'm not talking about launch images though...these are just regular view controllers. Edit: Nevermind, I see what you mean. Thanks! – arcticmatt Sep 09 '14 at 23:05
  • 1
    This confused me too. No matter which phone I chose in the simulator, it told me that [UIScreen mainScreen] bounds].size.height was 568. I guess iOS is going to resize the screen unless it has launch images for the new device sizes. – JScarry Sep 10 '14 at 00:10
  • 1
    @JScarry Exactly. This is the same as old 3.5" iPhone apps when run on 4" iPhones. Unless the special launch image is added, the device assumes the app can't support the larger screen so it simply scales it to fit the screen. But the app still thinks it is on the smaller device. Adding the proper launch images allows the app to actually know it is on the larger device. – rmaddy Sep 10 '14 at 00:12
  • Note that you can also use storyboards/xib files as launch images now. Easy way to test. – arcticmatt Sep 10 '14 at 00:14
  • @arcticmatt I don't use storyboards or xibs, just code, so I can't speak to using the "Launch Screen File" option. – rmaddy Sep 10 '14 at 00:15
  • If I'm not using asset catalogs, do you know what I name the launch screen images for the new iPhones? – arcticmatt Sep 10 '14 at 00:20
  • @arcticmatt I haven't seen a specific naming convention. The section in the HIG has a link to another document that supposedly explains the naming convention but it doesn't actually say what it is. – rmaddy Sep 10 '14 at 00:30
  • @articmatt I wasn’t using asset catalogs either, but with the release of the GM, it appears that the only way to have Xcode display the icons and startup images in the project overview is with asset catalogs. I converted a couple of apps and it does make it easier to see which images are missing. – JScarry Sep 10 '14 at 14:22
  • The new Launch Screen xib file allows you to have only one 'resource' for all devices and screen sizes, instead of having a dozen launch images. – Eneko Alonso Sep 20 '14 at 21:57
  • @EnekoAlonso Assuming the app makes use of Interface Builder. None of my apps use storyboards or xibs. I only do my UIs in code so I need all of the separate launch images. – rmaddy Sep 20 '14 at 21:59
2

Adding Launch Image does not solve this problem.

You need to add LaunchScreen.xib into the project and add Launch screen interface file base name - LaunchScreen to Info.plist

Create a new project with Xcode 6 GM. You will see what LaunchScreen.xib is. You can copy it into your existing project.

Vince Yuan
  • 10,533
  • 3
  • 32
  • 27
  • As I stated in a comment, this is an alternative solution. But what rmaddy said also works just fine. – arcticmatt Sep 11 '14 at 17:14
  • If you just want to test your app, and haven’t created the new launch images yet, just pick a random .xib file for your Launch Screen File. It won’t display on launch, but the simulator will behave properly. i.e. it won’t resize your app. – JScarry Sep 11 '14 at 17:53
2

It doesn’t look like Apple updated the docs yet for the new launch image sizes, but you can find them from Xcode. If you add the new launch images as Maddy says, you can view the new sizes in the inspector panel. iOS 8 includes three new images and does not require different images if the Status Bar is hidden on launch. The sizes are:

iOS 8 iPhone Portrait
Retina HD 5.5  1242x2208
Retina HD 4.7  750x1334

iOS 8 Landscape
Retina HD 5.5  2208x1242

You can add them in Xcode or edit the json file in the .xcassets file and drop the images into the package. If you choose to edit the package, add these lines to the top of the file:

{
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "Default-736h@3x.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "3x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "Default-Landscape@3x.png",
      "minimum-system-version" : "8.0",
      "orientation" : "landscape",
      "scale" : "3x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "667h",
      "filename" : "Default-667h@2x.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "2x"
    }

I kept the naming convention they used before for the portrait files. There was never a landscape option on phones before, so I kept the naming convention for iPads. Of course, you can name them anything you want.

Edit: Note that the only phone that will launch in landscape mode is the iPhone 6 Plus. The rest of the phones will only launch in portrait mode.

JScarry
  • 1,507
  • 1
  • 13
  • 25
  • Ok, but if I set the 667h like this (without landscape) the splash wont show up at all. Although when I set it and run in landscape it shows me 568h in portrait orientation. I'm broken :( – Maciek Czarnik Oct 01 '14 at 16:27
  • I tried this, and it didn't work: http://stackoverflow.com/questions/43199231/is-it-okay-to-leave-out-unnecessary-launch-images Any idea why? Thanks. – Kartick Vaddadi Apr 04 '17 at 05:59
1

most of what @rmaddy said works, but when I goto the Images.xcassets to configure the LaunchImage, I just select the "LaunchImage", and select "Attributes inspector", in the inspector page, you will see the corresponding configure choices, the steps also works for App Icons

0oneo
  • 695
  • 7
  • 10
0

@JScarry, your solution is ok, but doesnt allow to show landscape image on iPhone 6. Here is a solution that works (it requires both landscape and portrait images to be in the same dimension 350x667, landscape image should be just rotated)

Community
  • 1
  • 1
Maciek Czarnik
  • 5,950
  • 2
  • 37
  • 50
  • I don’t have an iPhone 6 to test on, but as far as I can tell from the simulator and Xcode's creation of iconasset files, the iPhone 6 does not launch in landscape mode. I could be wrong, but I think that the only phone that launches in landscape mode is the iPhone 6 Plus. – JScarry Oct 01 '14 at 22:00
0

For me what solved the problem is:

I had to click on both the project and the target and change the targeted device family to point to not just iphone, but also iPads. Only then the magnified zoom went away

enter image description here

Just a coder
  • 15,480
  • 16
  • 85
  • 138