View under status bar in iPhone X simulator distorted

Viewed 1915

I have recently upgraded to xcode 9 and run my project on simulator iPhone X and the view under status bar is distorted. In other phone everything is working fine.

Distorted view in iPhone X

enter image description here

Undistorted view in other phones

enter image description here

2 Answers

If you don't use Safe Area, you can pin it to the Top Layout Guide with 0 constant:

enter image description here

Or you can enable Safe Area in File inspector of a View Controller, it's backward deployable back to iOS 9, and again pin the top with 0 constant.

enter image description here

set view's Y as 44. Status bar height is 44. If navigation bar is there, make it 145. I hope it will work

Related