gpt4 book ai didi

ios - 使用自动布局将 UIButtons 设置为等距离

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:56:37 25 4
gpt4 key购买 nike

我的问题是我无法找到一种方法来设置 3 个 UIButton 彼此等距离,以及 2 个外部按钮与左右两侧的距离相同。

这基本上是一个包含 3 个按钮的下拉 View ,x 定位的约束都需要以某种方式相互关联。

我错过了 Autolayout 中的什么概念?

enter image description here

最佳答案

Autolayout 不支持开箱即用。

幸运的是,有一种巧妙的方法可以做到这一点。在按钮之间插入透明的 UIView。将这些 UIView 的宽度标记为彼此相等。现在它们之间的间距相等。

这就是它的样子。 Portrait. enter image description here

关于ios - 使用自动布局将 UIButtons 设置为等距离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38137111/

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