gpt4 book ai didi

ios - 什么是自动布局基线?

转载 作者:搜寻专家 更新时间:2023-11-01 06:30:27 25 4
gpt4 key购买 nike

当我使用自动布局时,我通常将对象附加到底部,而不是基线。但什么是 - 基线?我无法从苹果文档中找到好的答案,无论是在 SO 上。

来自 here我只发现基线只是一条水平线,从底部开始向上,但居中的 Y 线较低。

有人可以解释它是什么以及为什么有人要使用它吗?对我来说,将 View 附加到底部要容易得多。

最佳答案

根据 Apple 文档,UILabel 或其他带有文本的 UI 元素的基线是“标签内文本的垂直对齐方式”。在 UIView 的文档中,它指出:

When you make a constraint to a view’s baseline attribute, Auto Layout uses the baseline of the view returned by this method. If that view does not have a baseline, Auto Layout uses the view’s bottom edge

关于ios - 什么是自动布局基线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48120678/

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