Reputation: 2873
In Xcode with Swift and Auto Layout.
I placed a MapView to and applied Auto Layout constraints :
Trailing Space to superview: Equals 0
Leading Space to superview: Equals 0
but these leave a space of 16px on each side. So I changed them to:
Trailing Space to superview: Equals -16
Leading Space to superview: Equals -16
That worked just fine for iPhone 6, but when I tested it with iPhone 6 Plus I found a space of 4px on each side. If I changed my constraints to -20s then for the iPhone 6 the two 4px will be hidden.
Is there a way to stick a view to the edge for both devices using Auto Layout without specifying pixels?
Upvotes: 1
Views: 754
Reputation: 19641
Uncheck Constrain to margins
in the "Pin" dialog, and use 0 as left/right space:
Upvotes: 4
Reputation: 95
You can use size classes,then add new constraints,problem solved!!
Upvotes: 0