ios - 在不同大小的按钮上使用 StackView

标签 ios swift uistackview

我在使用具有不同大小按钮的堆栈 View 时遇到问题。

这就是我试图通过 StackView 实现的目标 enter image description here

我在使用堆栈 View 时遇到问题,因为按钮“=”和“0”的大小不同。

这就是我所管理的,但是您可以看到对齐不正确并且尺寸不对。 enter image description here

By looking at the images, does anyone have any suggestions on how I can achieve the desired look?

最佳答案

这是我的解决方案(用于 = 按钮)。 enter image description here

堆栈 View 的分布是(在 Outline 中从上到下):

按比例填充

填充

均匀填充

均匀填充

关于ios - 在不同大小的按钮上使用 StackView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37641616/

相关文章:

arrays - 在数组中搜索一个值 [swift]

ios - 在 iOS 9 上更改隐藏属性时,UIStackView 不会设置动画

ios - 国际化问题排查

ios - View Controller 无法找到带有标识符的 Segue

ios - 使用弹出库时的不同 View 层次结构

ios - 更新 imageView swift 4 的高度约束时无法同时满足约束

ios - 在 UITextView 中输入文本和单击返回按钮有什么区别?

ios - 选择视频时 iOS 10.3 中的 UIImagePickerController 崩溃

ios - matchedGeometryEffect 动画效果不流畅

ios - UILabel 中文本之前和之后的行