Assuming you're using Xcode 6...
There are two things to keep in mind when setting Auto Layout constraints regarding margins:
1. Adding new constraints
Xcode defaults new constraints to include margins. You'll find this on the 'Pin' menu - there's a checkbox that defaults to "Constrain to margins":
In the above screenshot, the left and right constraints both include margins. Unchecking this box will show the distance in points not including the margins:
2. Removing the margin calculation from an existing constraint.
You can adjust a constraint to not include the margin by selecting the constraint and accessing the Size Inspector (5th icon in right-hand panel, or Command+Option+5) and editing the portion that is relative to the margin. Access the dropdown and unselect the "Relative To Margin" option:
Note that the constant value itself will stay the same, but the object will adjust and not longer take the margin into consideration.
Lastly, I haven't found a way to turn this behavior off.. I would prefer to not have constraints set against the margins by default, but as far as I am aware with Xcode 6.1.1 there isn't a way to change this behavior.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…