auto layout leading or trainling -16

点点圈 提交于 2019-12-24 03:25:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!