Black bars appear in app when targeting iOS7.1 or 7.0 in Xcode6
Asked Answered
S

5

45

Steps to reproduce:

  1. Create a new project using Xcode6 (single view template, iPhone only, Objective-C)
  2. Navigate to project settings and change the deployment target from 8.0 to 7.1
  3. Run the application on a iPhone5/S with 7.1 installed or in the iPhone5/s 7.1 simulator (You may have to download the iOS7.1 simulators)
  4. The app appears with black bars on the top and the bottom.

enter image description here

If you run the application on the iPhone5/S 8.0 simulator, the screen will appear as expected, all white.

Why is this happening? Is there a fix or workaround?

Scrapple answered 12/9, 2014 at 22:6 Comment(0)
S
102

I was able to resolve the issue manually, seems like it is a bug with Xcode for now and I will file a radar report.

To resolve the issue, follow the below steps:

  1. Navigate to project settings
  2. Under "App Icons and Launch Images" click on "Use Asset Catalog"
  3. Select "Migrate" on the popup that appears.

This should fix the issue.

Scrapple answered 12/9, 2014 at 22:19 Comment(4)
Yep. Works for me to. Out of curiosity, did you hunt and peck for the fix or did you find something in the docs?Shrader
I had to hunt, narrowed it down by trying to think of what difference existed between one that did not have the black bars and one that did. There must be some condition in the compiler that was put in place during the switch from 3.5" to 4" devices and it is now triggered my something that seems like a pretty normal use case.Scrapple
As an aside, my instance of Xcode 6 presented the "migrate" option a long time ago and I did it before I had this issue. But, using your answer as a hint, I was able to solve my issue by looking at what missing in the Launch Images and App Icon sections like you suggested. My issue turned out to be that I was missing the "iOS7.0 and later" iPhone launch image!! Can't believe it was that simple! Cheers for figuring this out!Milklivered
Unfortunately this didn't work for me. I was already using asset catalogs, so I clicked "do not use asset catalogs", then followed the instructions. Still having the same problemKamilah
P
17

I encountered the same problem some days ago and I founded out that the problem in my case was the missing LaunchScreen.xib in General setting under App icons and launch images:

enter image description here

Privateer answered 4/5, 2015 at 8:10 Comment(3)
In my case, migrating the App Icon and Launch Image wasn't sufficient. When I set the Launch Screen File to my regular Storyboard it worked out nicely.Honkytonk
Thanks. My icons and launch images were also already set correctly, but LaunchScreen was blank. This fixed it for me.Necrophobia
So simple, yet so satisfying : )Effete
F
4

I had the same issue with Xcode 7 beta 1 and the UICatalog sample code and could resolve it by choosing Main.storyboard in General Settings under App Icons and Launch Images for the Launch Screen File.

Frohne answered 27/6, 2015 at 9:51 Comment(0)
K
2

I've encountered the same issue. It seems that LaunchScreen.xib can't adapt to the screen size of all 4-inch devices under iOS7.

Kalif answered 14/9, 2014 at 4:2 Comment(1)
Correct, check my answer to my question for the fix.Scrapple
S
1

On iOS7 (which I was testing on) if I did not add the 640x1136 image in the LaunchImage assets for iPhone Portrait 7.0 Retina I would get the top and bottom bar. Adding the asset in PNG format resolved the issue on iOS7.

Sawyers answered 2/12, 2015 at 0:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.