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 上不居中


基础教程推荐
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01