What does “Constrain to margins” mean in Interface Builder in Xcode 6.0.1

耗尽温柔 提交于 2019-12-04 17:48:23

问题


I understand the purpose of "Spacing to the nearest neighbor" (in Xcode 6, more especially in Interface Builder) but what is the point of "Constrain to margins"?

Is there a link between "Spacing to the nearest neighbor" an edge of a particular control button, and the fact of at the same time checking the checkbox named "Constrain to margins"?

What is the role of this feature in Autolayout?

Please find a screenshot with the checkbox and the label that I am talking about surrounded in red below:

(Screenshot above in bigger format)

Thank you in advance for your answers to my three questions.


回答1:


iOS8 introduces a new property of the UIView: layoutMargins. Shortly: these 4 values (a UIEdgeInsets) represent the margins of the view: its subviews can now be positioned relative to these margins, or the old way relative to the sides. I wrote an article about this in my blog with more details, let me know if it is clear and if you have additional doubts.



来源:https://stackoverflow.com/questions/26292775/what-does-constrain-to-margins-mean-in-interface-builder-in-xcode-6-0-1

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