iOS 9 Xcode 7 - Application appears with black bars on top and bottom

后端 未结 14 1295
野趣味
野趣味 2020-11-22 11:31

Installed the app on iPhone 6 iOS9 and here is what happened. Notice black bars on top and bottom. It works just fine on iOS8. How I can fix it?

I\'ve tried building

相关标签:
14条回答
  • 2020-11-22 11:50

    Swift 4.2

    select LaunchScreen.storyboard if its empty

    0 讨论(0)
  • 2020-11-22 11:51

    Did you migrate your app from an earlier version of Xcode? If so then Xcode is now making an assumption about your screen size and you need a way of indicating the actual screen size at run time.

    There are two ways:

    a) If you use a launch screen.

    You are missing a LaunchScreen.storyboard file. Create a LaunchScreen.storyboard file and add it to your project.

    b) If you don't use a launch screen.

    Go to your Target's settings and choose General, then App Icons and Launch Images. Now set "Launch Screen File" to your "main.storyboard" (or another storyboard if appropriate)

    0 讨论(0)
  • 2020-11-22 11:51

    For me the problem is i'm migrating my app from earlier version of Xcode and the project is missing LaunchScreen.storyboard file. I have just created LaunchScreen.storyboard and added it to launch Screen File. This did the trick.

    0 讨论(0)
  • 2020-11-22 11:52

    In my case I have one asset with launch images however it was displaying the top and bottom dark bar as well.

    I've tried the launch storyboard solution and yes it works but I didn't want to add a new file so, this is what I did to fix the issue:

    1. Copied my launch images to another folder
    2. Removed the existing LaunchImage asset
    3. Added a new LaunchImage asset
    4. Added the images to the new LaunchImage

    That's it!

    0 讨论(0)
  • 2020-11-22 11:55

    This one is if you do not use storyboard at all.

    It occurs when you remove LaunchScreen from Launch Screen File in App icons and Launch Images.

    Instead of removing it from here go to info.plist and find Launch screen interface file base name and remove LaunchScreen, i.e. leave it blank.

    It wont show in info.plist if you have removed LaunchScreen already from Launch Screen File. Then you can give any name in Launch Screen File and it will appear and you can remove the name.

    0 讨论(0)
  • 2020-11-22 11:55

    In my case, I have several targets in the project and each one has it's own launch screen images. The weird thing one of the targets looks fine but others have those black bars. The thing was in the name of Launch folder inside assets. Change name to LaunchImage solves the problem.

    0 讨论(0)
提交回复
热议问题