View in status bar in iPhone X simulator is distorted

I recently upgraded to xcode 9 and ran my project on an iPhone X simulator, and the view in the status bar is distorted. In the other phone everything is working fine.

Distorted look in iPhone X

enter image description here

Undistorted view on other phones

enter image description here

+5
source share
2 answers

If you are not using a safe zone, you can bind it to the Top Layout Guide with a constant of 0:

enter image description here

Or you can enable the Safe Zone in the File Inspector of the View Controller, back back to iOS 9 and pin the top back again with a constant of 0.

enter image description here

+3
source

set Y to 44. The status bar is 44. If the navigation bar is there, make it 145. I hope it works

0
source

Source: https://habr.com/ru/post/1272024/


All Articles