How to increase the color of the lower view below the home indicator in iphone X?

Please check the attached image. The background color of the Viewcontroller view is blue. This color goes below the status bar and below the home indicator, as you can see. Below there is a white view, which is a button. Here the white view is inside the safe placement guide.

I want the same white color to expand below the home indicator without adding an extra look for iphone X only.

How to do it?

enter image description here

+8
ios swift iphone-x safearealayoutguide
source share
3 answers

You need to set / attach the lower limit of the white view with the super view.

Follow these steps and see:

  • Check the bottom / bottom alignment of your view. It can be attached with a lower anchor / safety zone restriction.

enter image description here


  • (To edit it) Double-click on the lower restriction, which will show the following options.
  • Now change the selection (checkmark) from the safe area to the superview.

enter image description here


  • set the constant to 0 if not.

enter image description here


  • Here is the result you may wish for.

enter image description here

+8
source share

Krunal's answer works in most cases. But if you do not have this set of upper limit, the white view will be under the home indicator line.

enter image description here

In my design, the white look had only leading, final, lower and upper limits. I had to add another view in the form of a white view (now this view will be a white view), include a guide on planning a safe area for the external white view, and set limits for the field / safe area to get this thing for all devices, including X.

NB: the height limit should be set for the appearance / button (in my case), and not for appearance. Autolayout will do the job right for you on your iphone X.

enter image description here

Here's what it looks like on iphone X and other phones. iPhone SE:

Iphone 5c

iPhone X:

enter image description here

Hope this can help someone. :)

+4
source share

In my case, I wanted the bottom view to have a height of 49. Therefore, set the top to 49 above the bottom layout guide.

enter image description here

Then set the bottom of the view to the lower bottom view.

enter image description here

Now on the iPhone X, the view continues to the bottom of the phone and still has a height of 49 above the safe area, and on other devices, the height of the view is 49.

+1
source share

All Articles