5

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?

Olcay Ertaş
  • 5,987
  • 8
  • 76
  • 112

3 Answers3

4

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

hasan
  • 23,815
  • 10
  • 63
  • 101
0

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

Parth
  • 634
  • 8
  • 15
0

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

Roberto Juárez
  • 115
  • 1
  • 4