Black bars appear in app when targeting iOS7.1 or

2019-01-10 03:38发布

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?

5条回答
Bombasti
2楼-- · 2019-01-10 03:43

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.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-01-10 03:50

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.

查看更多
神经病院院长
4楼-- · 2019-01-10 03:55

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.

查看更多
Animai°情兽
5楼-- · 2019-01-10 03:57

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.

查看更多
Rolldiameter
6楼-- · 2019-01-10 04:07

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

查看更多
登录 后发表回答