0

I added a subView inside a super view. They have same x-location. Then I added a leading constrain between these two but the constrain value is -20. I faced this issue many times. I don't know why they seems aligned together but the constrain is -20 different.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
  • Check the comments here. http://stackoverflow.com/questions/29875187/why-do-i-have-to-set-trailing-space-to-16-in-interface-builder-to-get-full-scre – Shamas S Apr 20 '16 at 03:07

2 Answers2

1

The margins are different for each device size.

The right way to set the space between the boundaries and your view to 0 is to uncheck the constrain to margins checkbox

enter image description here

alephao
  • 1,234
  • 13
  • 20
0

It's because the default constraints are relative to margin. If you don't want the -20, uncheck the "constraint to margins."

Xchord
  • 678
  • 1
  • 5
  • 20