Reputation: 2762
I'm trying to set up a basic storyboard using the Single View Application template in Xcode. The Main.storyboard has one view controller in it. I can add a subview and I can size it fill its parent view, but if I add autlayout constraints, it thinks that the leading and trailing edges need to be set to -16 to fill the screen. If I set them to 0, like I would expect to work, then it has a 16 point gap on the sides of the view.
Does anyone know why it insists on having constraints set to -16?
Upvotes: 1
Views: 863
Reputation: 119242
You've created constraints to the margins of the superview, not its edges. The edge of the view is 16 points from the margin.
This is new in Xcode 6. You can change this by altering the individual constraints (where it says the "item" as superview.margin or similar, in the attributes inspector) or by creating the constraints with the "use margins" box unchecked.
Upvotes: 7