'How to get rid of white space at bottom of Launch Screen on iPhone X

There is a white space at the bottom of the launch screen on iPhone X even though I am using safe area.

White space at the bottom

On interface builder it seems OK:

On interface builder

I am using superview for my constraints:

Constraints

Here is the view hierarchy:

View hierarchy

How can I get rid of it?



Solution 1:[1]

The white space you see is the controller default view background color.

The problem is when you try to add a top/bottom constraint to any view. It adds the constraint to the Layout Guide (default behavior).

To over-write that. you can click the arrow next to the constrait constant value. which shows the views that you can connect against. obviously you need to connect with the one with the largest distance value, and set the constant value to 0.

enter image description here

Same applies to the launch screen controller.

If you have the constraint already added. you can change that from the constraint Attributes Inspector:

enter image description here

If you have a top constraint you need to choose the First Baseline. and if you have a bottom constraint you need to choose Last Baseline

Solution 2:[2]

If Using LaunchScreen then do the following

first setup LaunchImage with proper size and reference to correct assest.

Remove Launch screen File or set nil enter image description here

Solution 3:[3]

This just solved my issue! Try to pick the SuperView option like the screenshot shows. I had the same issue for also the top of the screen, and I did the same procedure, and worked!

XCode screenshoot

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Parth
Solution 3 Roberto Juárez