gpt4 book ai didi

ios - 按钮与预期的 iO​​S Autolayout 不完全相同

转载 作者:可可西里 更新时间:2023-11-01 04:44:56 24 4
gpt4 key购买 nike

我正在尝试制作“两个等宽按钮”,如 Apple Auto Layout Guide 中所述。

https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/ViewswithIntrinsicContentSize.html#//apple_ref/doc/uid/TP40010853-CH13-SW1

它在界面生成器(Main.storyboard)的预览中看起来不错。但是当我尝试更改设备时,我发现某些设备上的宽度不同。我该如何解决?如何使用约束或其他技术使所有设备的按钮宽度相等?

更新示例:

宽度还可以

width is ok

宽度不对

width is not ok

Width is ok

Width is not ok

最佳答案

按钮的宽度没有问题。由于两个按钮之间有 0.5 点的差异,它可能不会向您显示相同的宽度。

只需手动检查两个按钮的宽度,它们之间可能没有差异,超过 1 点。

看看这个快照:

iPhone 5

enter image description here

苹果手机 8

enter image description here

iPhone X

enter image description here

enter image description here

enter image description here

关于ios - 按钮与预期的 iO​​S Autolayout 不完全相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50725276/

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