Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS9 App has black bars on top and bottom

My app doesn't use auto layout, it was originally designed for an iPhone 4/4s and the UI has been mostly untouched since then. The layout is fairly minimal, so it hasnt been deemed a priority to switch it autolayout.

Previously building for iOS8 my app would scale properly on iPhone 5, and newer, filling the screen. The View itself would fill the entire screen, while the icons would scale proportionally (such that they were not distorted). however it seems now that using the iOS9 beta the app receives black bars at both top and bottom, and its basically displayed as a scaled iPhone 4 app, resulting in black bars on the top and bottom.

Basically I want to it simply scale to fit the full screen, the same as it did in iOS8. Can anyone shine some light onto what has changed which has caused these black bars?

I should add, if it build using xcode 7 (ios9 xcode) and deploy a device with iOs8 it works fine, the issue is deploying to iOS9 devices.

The app looks like this on iOS9 now, the red area is the apps usable space now, whereas previously it was the entire size (note black bars).

like image 251
xceph Avatar asked Aug 31 '15 13:08

xceph


2 Answers

@Fantina @Goles I was able to temporarily fix this by creating and adding a [email protected] file with resolution 640x1136. I then updated the 'App Icons and Launch Images' Section to look like this:

No Image Source or Launch Screen File

I don't think this is a long term solution because in order to be compliant with iOS9 and split-screen apps, Apple is requiring storyboard or xib files. This makes it difficult for developers who rely solely on programatic view generation/layout. URGH.

like image 79
Jeremy C. Avatar answered Oct 20 '22 04:10

Jeremy C.


I had exactly the same issue, and this is weird, I've solved the error and I don't really know why my solution do the trick.

Add a Launch Screen File to your project (I've copied one from another newer project I have), and that's all, the app now uses all the screen again.

To add a Launch Screen File first create a xib file, use a UIView and fill with whatever you want.

enter image description here

Then you have to select the project in the left side of the screen, select the app target (not the project one), on the general tab search for App Icons and Launch Images and put the xib name you just created on Launch Screen File.

enter image description here

The problem with this, is that this activates the Size classes in the app interface, so you have to review your app's interface because scaling is no longer working.

PS: I'm using Xcode 7.0 GM

like image 10
Fantini Avatar answered Oct 20 '22 06:10

Fantini