问题描述
第一基准和最后基准属性对UIStackView
的子视图有什么影响?
What effect do the First Baseline and Last Baseline properties have on the subviews of a UIStackView
?
通常,有人可以说明这些值的实现吗?
Generally, can someone please illustrate the implementation of these values?
推荐答案
假设您有两行文本视图(或字段,标签或按钮)和三行文本视图,然后将它们添加到水平堆栈中看法.您要对齐他们的第一行还是最后一行?就是这样.
Suppose you have a two-line text view (or field or label or button) and a three-line text view, and you add them to a horizontal stack view. Do you want to align their first lines, or their last lines? That's the difference.
.FirstBaseline
:
.LastBaseline
:
注意:我将垂直内容拥抱和抗压缩优先级提高到1000(必填),以使其正常工作.
Note: I increased the vertical content hugging and compression resistance priorities to 1000 (required) to get this to work properly.
这篇关于UIStackView中的第一个基准和最后一个基准属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!