问题
If I just drag a View to occupy all the available screen, when I tried to set auto layout leading and trailing space, it is always saying -16, I am thinking shouldn't it be 0 to the left/right edges?
If I set to 0, actually the view will shrink horizontally by 16 for left and 16 for right.
I am a little confused, why there is a 16 difference?
回答1:
When you first add UIView in your super View. and set constrain default leading and trailing is -16 as below image.
deselect on constrain to margins it automatically set 0 of leading and trailing as below image. after set you leading and trailing of view.
来源:https://stackoverflow.com/questions/28040483/auto-layout-leading-or-trainling-16