Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 GM iPhone 6 Simulator - Storyboards not sizing correctly, appear zoomed in

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).

like image 740
arcticmatt Avatar asked Sep 09 '14 22:09

arcticmatt


3 Answers

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

like image 125
rmaddy Avatar answered Nov 06 '22 22:11

rmaddy


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.

like image 2
Vince Yuan Avatar answered Nov 06 '22 20:11

Vince Yuan


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" : "[email protected]",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "3x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "[email protected]",
      "minimum-system-version" : "8.0",
      "orientation" : "landscape",
      "scale" : "3x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "667h",
      "filename" : "[email protected]",
      "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.

like image 2
JScarry Avatar answered Nov 06 '22 20:11

JScarry