What do “Use standard value” and “Constrain to Margins” mean in Auto Layout?

戏子无情 提交于 2019-12-02 18:19:50

What are the differences between standard value, manual values, and canvas values?

Standard value uses "the recommended spacing for constraints that specify distance between items", which is usually around 10 points.

Current canvas value copies the value from how you have the objects currently displayed on the canvas.

Manual values are whatever you want.


What does the constrain to margin checkbox do?

This constrains to a container view's margins instead of its edges. From the docs:

“Horizontal and vertical constraints to a container view can be to the margin or to the edge. Margins correspond to the values in the layoutMargins atttribute of UIView and specify recommended minimal distances between an edge of a container view and the corresponding edge of a child.”

You can set a view's margins using the layoutMargins property.


What does align do?

This creates a constraint that edges or center of one view should be aligned with edges or center of another view. For example, in a column of text views, you might want every text field to have their leading and trailing edges aligned.

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