Jas*_*man 6 uikit uiview ios uistackview
我想设置一个 UIViewStack 以便它将两个视图居中放置,即使它们具有不同的宽度。下面是一个例子:
是否可以使用 UIStackView 实现这种类型的配置?我似乎无法弄清楚!
任何帮助,将不胜感激。
不,你不能。来自苹果的文档
\n\n\n\n\n堆栈视图使用自动布局来定位其排列视图并调整其大小。stack 视图将第一个和最后一个排列的视图与其边缘沿 stack\xe2\x80\x99s 轴对齐。
\nIn a horizontal stack, this means the first arranged view\xe2\x80\x99s leading edge is pinned to the stack\xe2\x80\x99s leading edge, and the last arranged view\xe2\x80\x99s trailing edge is pinned to the stack\xe2\x80\x99s trailing edge.
您可以使用约束来代替。
\n| 归档时间: |
|
| 查看次数: |
4378 次 |
| 最近记录: |