Search code examples
iosswiftautolayoutiphone-x

why I see white white area in the bottom of my iPhoneX simulator?


I have read some answer in the stackoverflow like this one Seeing black bars at the top and bottom of the iPhone X Simulator , but it seems little bit different since my issue only happens only in the bottom area of my screen

enter image description here

as we can see, there is a white area in the bottom of my loginVC. I want my UIImage (background image) to cover that white screen area.

i have set the image bottom constraint of the UIImage to the safe area like below

enter image description here

I have also used "use safe area layout guides"

enter image description here

what went wrong in here?


Solution

  • Remove align bottom to Safe Area and add Bottom Space to super View (attach bottom space to superview, similar to your top space - is attached with superview)

    (Also, set align bottom to Safe Area for your label containing text "Please contact IT support")

    enter image description here

    Update:

    This is a kind of patch solution to your problem. You should actually set Layer outside your safe area layout (Set all anchors of Layer 1357 with respect to super view) and add additional transparent view (UIView) attached with (all anchors) Safe Area layout, containing all other UIElements, to handle it very easily.