Seeing black bars at the top and bottom of the iPhone X Simulator

IosUinavigationbarIos SimulatorXcode9Iphone X

Ios Problem Overview


Running my App in the iPhone X Simulator (GM Seed) I am noticing two strange effects:

  • the App does not use the full screen space (top and bottom area is black)
  • a strange white bar beneath the title bar

enter image description here

Does anybody know what is happening here and how to resolve this? I can't find any new settings in Interface Builder.

Ios Solutions


Solution 1 - Ios

When using launch images (instead of the much easier Launch screen file), you need to provide the properly sized launch image for each device size you wish to support. Once you add the additional launch image, your app should take advantage of the new screen size.

The new iPhone X requires a launch image sized at 1125px × 2436px which is a 3x image for 375pt × 812pt.

Of course if you switch over to using a Launch screen file instead of individual launch images, your app will automatically adapt to all device sizes without any additional work.

Solution 2 - Ios

I have figured out this issues in iPhone X. Launch image size (1125*2436px) Please flow this below steps. 1.i)Choose your project name in Xcode. ii)Select your project target iii)Then select Launch images source enter image description here

  1. You can get Migrate popup i) Choose Assets ii)Select Migrate

enter image description here

  1. After that select your Assets.xcassets in your project enter image description here

  2. Then select Launch image in assets i)Then select attribute inspectorenter image description here

  3. finally check your Launch image source. you can see set Launch image.

enter image description here

Solution 3 - Ios

iPhone X needs different launch image sized 1125px x 2436px (375pt x 812pt @3x).

enter image description here

Check human interface guidelines for more details.

Solution 4 - Ios

I have figured out how to fix (though I still don't understand why this happened only on iPhone X) LaunchScreen storyboard on iPhone X with seeing black top&bottom bars.

I have LaunchScreen storyboard with one UIImageView.

UIImageView's top&bottom has to be pinned to SuperView's top&bottom. NOT to SafeArea.

Solution 5 - Ios

I fixed it by simply inserting some random text in the Lanch Screen File textfield. I dont even have a Launch Screen File... XCode is so buggy.

update

Although this fixes it in simulator (still very weird and unexpected) when uploading a binary to iTunes Connect it will fail due to not finding a LanchScreen file of name "random-name"

Solution 6 - Ios

Just ran into this while trying to update an app I hadn't worked on in a while.

On Xcode 9.4, I was able to fix this by doing the following:

  1. Add a launch screen by going to File -> New -> File... -> Launch Screen

enter image description here

  1. Make sure the newly added launch screen storyboard is selected as the launch screen file under project settings.

enter image description here

Solution 7 - Ios

If you already have a 1125px × 2436px launch image but the app is still not using the full screen check to make sure that your image is PNG.

Solution 8 - Ios

if you removed LaunchScreen.storyboard; Choose your project, select your project target, General -> App Icons and Launch Images -> Launch Screen File: Select here Main.storyboard instead of LaunchScreen.storyboard

Solution 9 - Ios

Just had this problem... When I selected the project & the correct target I had a blank for the 'launch screen file' under the app icons and launch screen images tab. I set it to the default LaunchScreen and the resizing issue I faced was taken care of.

Solution 10 - Ios

You may check in project target launch screen file is not set to empty if it is empty it may cause problem.enter image description here

Solution 11 - Ios

Yes me too face that top spacing issue in iOS 15,

iOS 15 needs some new size of the Launch images

So you please check your all the launch screen images

Check your Attribute inspector is portrait for Launchscreen

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDarkoView Question on Stackoverflow
Solution 1 - IosrmaddyView Answer on Stackoverflow
Solution 2 - IosKarthick CView Answer on Stackoverflow
Solution 3 - IosLal KrishnaView Answer on Stackoverflow
Solution 4 - IossabilandView Answer on Stackoverflow
Solution 5 - IosArbiturView Answer on Stackoverflow
Solution 6 - IosMyxticView Answer on Stackoverflow
Solution 7 - IosBlagoView Answer on Stackoverflow
Solution 8 - IosBedri KeskinView Answer on Stackoverflow
Solution 9 - IosRevanth MathaView Answer on Stackoverflow
Solution 10 - IosAqib ZareenView Answer on Stackoverflow
Solution 11 - IosPrabakaran MuthusamyView Answer on Stackoverflow