xcode UIStackView 中的第一个基线和最后一个基线属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33932846/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
First Baseline and Last Baseline Properties in UIStackView
提问by Burhanuddin Sunelwala
What effect do the First Baselineand Last Baselineproperties have on the subviews of a UIStackView
?
做了什么样的影响第一基线和上次基线性能有一个子视图UIStackView
?
Generally, can someone please illustrate the implementation of these values?
一般来说,有人可以说明这些值的实现吗?
回答by rob mayoff
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
:
.FirstBaseline
:
.LastBaseline
:
.LastBaseline
:
Note: I increased the vertical content hugging and compression resistance priorities to 1000 (required) to get this to work properly.
注意:我将垂直内容拥抱和压缩阻力优先级增加到 1000(必需)以使其正常工作。