gpt4 book ai didi

ios - 自动布局中的 "Use standard value” 和 “Constrain to Margins"是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 08:20:27 25 4
gpt4 key购买 nike

我学习了一些自动布局教程,例如 this .但是我仍然不清楚以下选项在 pin 对话框中的作用

enter image description here

  1. 标准值、手动值和 Canvas 值之间有什么区别?

  2. constrain to margin 复选框有什么作用?

  3. align 有什么作用?

最佳答案

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

标准值使用"the recommended spacing for constraints that specify distance between items" ,通常在 10 分左右。

当前 Canvas 值 从当前在 Canvas 上显示对象的方式复制值。

手动值是您想要的任何值。


What does the constrain to margin checkbox do?

这限制了容器 View 的边距而不是它的边缘。来自 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.”

您可以使用 the layoutMargins property 设置 View 的边距.


What does align do?

这会创建一个约束,即一个 View 的边缘或中心应与另一个 View 的边缘或中心对齐。例如,在一列 TextView 中,您可能希望每个文本字段的前缘和后缘对齐。

关于ios - 自动布局中的 "Use standard value” 和 “Constrain to Margins"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29705747/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com