我的按钮在 iPhone 6 和 6 plus 上居中,但在 iPhone 5 上不居中 [英] My button is centered for iPhone 6 and 6 plus, but not for iPhone 5

查看:22
本文介绍了我的按钮在 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 上不居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆