Dylan
Dylan

Reputation: 2365

Bug in Interface Builder? Safe Area extends past window bounds

I haven’t seen this one before. After switching my simulated device from iPhone SE to iPhone X and back, I found the Safe Area now extends past the edges of the iPhone SE window. (It’s fine when I switch to iPhone X.)

Is this a bug in Interface Builder or something I didn’t previously know about how Safe Area works? Either way, how do I fix this? I’ve tried quitting Xcode (version 9.4.1) and restarting...

enter image description here

Upvotes: 2

Views: 330

Answers (2)

Eric Stevenson
Eric Stevenson

Reputation: 74

had the same issue but with IPad mode.. deleted the trailing and leading constraints of the main stack view and solved.

Upvotes: 0

Dylan
Dylan

Reputation: 2365

Found it. It turns out that I’d used the “Add Missing Constraints” feature along the way someplace -- probably while I was viewing in iPhone X mode -- which added two leading and trailing edge constraints to one of my interior elements. These constraints were too wide when in the iPhone SE mode.

What’s new for me is to discover that the “Safe Area” can be wider than the phone itself. So it might not be a bug, but conceptually it still feels odd to me...

Upvotes: 2

Related Questions