Why does Leading/Trailing space show as -16?
Asked Answered
U

2

8

As I updated my Xcode from version 5 to 6 I saw a strange things in the storyboard. Here is one example:

  • What my requirement was - I wanted no space between my view and the container view.
  • What I did - I dragged the views left/right edge so that it meets the container margin. And then I put a horizontal spacing constraint.

Earlier the value used to be - Leading/Trailing Space to:Superview Equals:0

Now after updating to Xcode 6 it always shows - Leading/Trailing Space to:Superview Equals:-16.000000

Why does this happen?

Understudy answered 3/2, 2015 at 5:45 Comment(0)
T
12

That's container's margin. I think it applies the default margin to the edges. If you want to set up the Leading/Trailing Space to Superview constraint then you can do so.

enter image description here

If you have already created the constraint then you can select that constraint and uncheck Relative to margin

enter image description here

Please note the Relative to margin feature is only available on iOS >= 8, the app will crash (not sure but it should) on iOS < 8.

Tini answered 3/2, 2015 at 5:52 Comment(0)
C
5

Try to uncheck "Relative to margin" enter image description here

Cerebrovascular answered 6/5, 2015 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.