Reputation: 271
I have a logo in the storyboard set to a top constraint of value 28 and it works for all devices. On iPhone X device it merges with the camera bar on the top. If i increase the top constraint it affects the other devices. How do i set a constraint only for iPhone X alone?
Upvotes: 2
Views: 2295
Reputation: 1056
By default Xcode provides you with a Safe Area
upon project creation.
Here, I've added a UIView
with the following constraints. Take note of how the constraints are pinned to the Safe Area
, and not the Superview
.
Running the app, you'll see that the view respects the status bar across all devices.
Hope this helps with the issue you're having...
Upvotes: 7