UIStackView中的第一个基准和最后一个基准属性 [英] First Baseline and Last Baseline Properties in UIStackView

查看:97
本文介绍了UIStackView中的第一个基准和最后一个基准属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一基准最后基准属性对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中的第一个基准和最后一个基准属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆