My button is centered for iPhone 6 and 6 plus, but not for iPhone 5(我的按钮在 iPhone 6 和 6 plus 上居中,但在 iPhone 5 上不居中)
问题描述
我确实启用了自动布局,但由于某种原因,我的中心按钮没有针对其他手机尺寸居中.我设置了约束,就像我提到的自动布局一样,所以我有点困惑.所有其他项目都在它们应该在的位置,按钮、其他标签等.顶部的一个特定标签正好偏离 iPhone 6 以外的所有型号的中心.
I do have autolayout on, but for some reason my center button isn't being centered for other phone sizes. I have constraints set and like I mentioned autolayout, so I'm somewhat confused. All other items are where they should be, buttons, other labels, etc. One specific label at the top is just off center for all models aside from iPhone 6.
推荐答案
如果我没记错的话,你没有给你的标签添加任何约束,这就是它不在中心的原因.
If I am not wrong you didn't add any constraint to your label that's why it is not at center.
为标签添加此约束.
所有屏幕的结果:
这篇关于我的按钮在 iPhone 6 和 6 plus 上居中,但在 iPhone 5 上不居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我的按钮在 iPhone 6 和 6 plus 上居中,但在 iPhone 5 上不居中


- URL编码Swift iOS 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- UITextView 内容插图 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01