6

So when I run my project on the simulator for iPhone 6, with a deployment target of 7.1 I'm expecting everything to Scale automatically for the larger screen size.

But this is not happening. My UILabel which was previously horizontally in the center of a 320px wide storyboard screen, with a leading space constraint to the parent view, now shows up in the simulator with exactly that space constraint, instead of it being scaled. So it shows up off center, because the iPhone6 is wider.

What setting determines whether the app get's scaled for iPhone 6 and iPhone 6+ ???

Paul G.

7
  • There is no such setting. You need to set up the correct constraints. If you want it centered use a centerX constraint (not a leading edge one), and it will be centered in any size screen.
    – rdelmar
    Sep 21, 2014 at 19:21
  • @rdelmar, apps on the app store before iPhone 6 will scale automatically for iPhone 6. Why? What determines that.
    – Fraggle
    Sep 21, 2014 at 19:22
  • Like, I said, you need to set up the correct constraints. If you use a center constraint instead of an edge one, it will automatically be centered, no matter the screen size. You need to design your constraints to take into account future changes in screen size.
    – rdelmar
    Sep 21, 2014 at 19:25
  • 1
    Does you project have a Base SDK of 8.0? Does it have the new "Launch Screen File" set?
    – rmaddy
    Sep 21, 2014 at 19:25
  • @rdelmar That's not the issue. An app not setup to use the larger iPhone 6 size will simply scale. Everything should look the same with no changes. It will just be physically larger to fill the screen.
    – rmaddy
    Sep 21, 2014 at 19:26

1 Answer 1

6

Ok, I found it:

What's new in iOS8

"To let the system know that your app supports the iPhone 6 screen sizes, include a storyboard launch screen file in your app’s bundle. At runtime, the system looks for a storyboard launch screen file. If such an file is present, the system assumes that your app supports the iPhone 6 and 6 Plus explicitly and runs it in fullscreen mode. If such an image is not present, the system reports a smaller screen size (either 320 by 480 points or 320 by 568 points) so that your app’s screen-based calculations continue to be correct. The contents are then scaled to fit the larger screen."

So I removed LaunchImage.xib (which was put there automatically) and I removed the entry for that in the plist.

4
  • anyone who's doing this should be considering using autolayout instead of depending on scaling. What happens with scaling is that you'll get the same scale for elements such as the nav/status bar and keyboard, rather than taking advantage of the larger screen size. So you're getting a zoomed in app at the same resolution of a smaller phone that you've designed for, instead of using autolayout to make sure your app works well for both small iphones and larger screens (iphone 6 and ipads). See tip #2 here. raywenderlich.com/89816/… Aug 27, 2015 at 20:51
  • @mitrenegade, yes this is true, but strangely autolayout does not automatically scale its constraints for the appropriate screen size. When your screen is more complex than a couple of full width table views, this presents problems that while solvable are not ideal (size classes, modifying constraints programatically, different storyboards, etc). Ultimately I think Apple should have a feature to scale constraints automatically.
    – Fraggle
    Aug 29, 2015 at 15:09
  • I totally agree. Whenever I come across a more complex screen it's already a pain to scale them relatively correctly for the iPhone sizes. What looks good on an iPhone 4S already doesn't look good on an iPhone 6. I do think that if a screen is complex enough for autolayout to be a pain, it's probably a point where you might want to redesign a layout for a tablet. Unless you have time for that, I guess scaling would be the next solution. I have come up with some complex ways to make constraints "scale" and it's usually a case by case solution. Autolayout has a lot more depth than most know. Aug 29, 2015 at 16:43
  • I have tried the suggestions above. No LaunchScreen storyboard in the App. The iPhone5 app seems to be scaling but it has a black band on the top and bottom.
    – OneGuyInDc
    Mar 1, 2016 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.