iOS9 App has black bars on top and bottom
Asked Answered
A

5

21

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

Antagonize answered 31/8, 2015 at 13:50 Comment(7)
You should at least add a screenshot.Pattani
Any luck? I have a feeling this has to do with missing launch images, but I can't seem to figure out which one we are missing! Also, we don't use 'Launch Screen Files' so populating field on the Project Settings won't help.Algia
Were you able to fix this?Chorea
@JeremyC. look at my answer, I've found a workaround to solve this.Burdick
My fix was to "simply" update all the images to supply the proper 3x images for the new 6/6S, Jeremy C's answer provides a working solution for removing the black barsAntagonize
Use top and bottom space issue with xCode 6+ and iOS 9Duramen
I think there is also a chance to issue in Model Presentation Style in Assistant Editor. I have the same problem and I changed Presentation style and it work for me.Raze
A
16

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

Algia answered 16/9, 2015 at 16:58 Comment(4)
It works great!! I've searched a lot for this!! Thanks!! Tested on Xcode 7 with all devices on Simulator with iOS 9 and it worked!!Mcginley
In my case, I also need setup "Launch Screen File" to MainStoryboard to ensure it work wellLennielenno
Worked for me. Except to note when I changed "app icons source" (which was red) there was a popup about creating an asset and then in "Launch Images Source" it let me select "Brand Assets". Jeremy C, can you give more details about what you wrote? My AppDelegate selects a root controller depending on state. I use XIBs but not storyboards and don't want any launch image - the app is small and there is no delay at all in the user seeing the first root controller so I don't see the point of flashing some kind of image for 10 ms...Paxwax
I'm not sure you can get around the requirement of not having a launch image. I believe this image is used as a view animation transition when the app opens up. My solution addresses the issue of providing a Launch Image without the use of Storyboards... I don't think you can omit a launch image/storyboard all together.Algia
B
10

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

Burdick answered 16/9, 2015 at 15:45 Comment(2)
Thanks for that. It's kinda ridiculously that it has to be done that way, but that works! You saved me cracking my head open on the desk :)Blinders
I know that feeling bro :)Burdick
I
6

I had a similar problem and I've solved it by setting up Main.storyboard as Launch Screen File in App Configuration Screen. It made all screens fit the entire screen.

Incorporate answered 18/9, 2015 at 12:7 Comment(1)
Best solution! Worked perfectly for me.Semination
P
2

You can add a LaunchScreen storyboard by : File/New/File..., and then in the iOS group, select UserInterface/Launch Screen.

Then select it as the Launch Screen for your app, as explained in the answer given by Fantini. That's with Xcode 7.0

Poise answered 22/9, 2015 at 0:12 Comment(1)
I tried this but still getting black letter boxing on iPads. Selected File -> New File -> UserInterface -> Launch Screen. Then added it as launch screen in Storyboard. Not fixed. iOS 8, Xcode 7Roadwork
N
1

I ran into this after upgrading to xcode 9. Interestingly the app looked fine when running on simulators but showed a black bar at the bottom when running on a connected device. In the menu choosing product and then holding Option -> clean build folder fixed the issue for me.

Neckar answered 26/9, 2017 at 19:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.