2

After upgrading my project from Swift 1.2/Xcode 6 to Swift 2.0/Xcode 7 all of my view controllers are rendering in 4:3 ratio (iPhone <=4). On iPhone <=5 then black space pads the top and the bottom of the screens.

Nothing has changed with the storyboard, and I am not dynamically sizing the views or using any other code to manipulate the view size.

What could be causing this issue, and how to resolve? I have tried a number of hacks including requesting full screen in the info.plist but cannot get it to work. It is frustrating since everything worked perfectly before Xcode7.

Below is a screenshot from an iPhone 6 showing the black space above and below the controller.

enter image description here

PassKit
  • 12,231
  • 5
  • 57
  • 75

3 Answers3

2

I resolved it by choosing 'Launch Screen File' as '*.storyboard' from Project Settings -> Targets -> App Icons and Launch Images.

syumai
  • 36
  • 2
1

It happens cause you do not have Launch images properly set.

  1. Go to image assets
  2. Hit + => "App Icons & Launch Images" => "New iOS Launch Image"
  3. Now you created a special image asset for launch image. Open it (it has 'LaunchImage' default name) and specify images for all kinds of screen width/height ratios.
  4. Also you have to look through project navigator and remove all files that probably exist as launch images (they are named 'Default.PNG', ''Default2X.PNG' or something).
fnc12
  • 2,241
  • 1
  • 21
  • 27
  • 2
    Thanks - it was launch image that fixed the problem. Setting the launch screen file to Main.Storyboard was a simpler solution, although your solution is equally valid. – PassKit Sep 26 '15 at 09:05
0

Suggesting a workaround: If it is an iPhone only app you can simply disable Size Classes from Storyboard: click on view -> enter file inspector (first tab of right panel) and uncheck "Use Size Classes".

Mike K
  • 961
  • 8
  • 15
  • Unfortunately I need both iPhone and iPad. Have tried turning off Size Classes and auto layout and neither have any effect. – PassKit Sep 25 '15 at 09:01