简体   繁体   中英

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

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

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.

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.

@rmaddy说的大部分内容都有效,但当我转到Images.xcassets配置LaunchImage时,我只需选择“LaunchImage”,然后选择“Attributes inspector”,在检查器页面中,您将看到相应的配置选项,步骤也适用于应用程序图标

@JScarry,你的解决方案还可以,但不允许在iPhone 6上显示风景图像。 这是一个有效的解决方案 (它需要横向和纵向图像在同一维度350x667,景观图像应该只是旋转)

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM