My button is centered for iPhone 6 and 6 plus, but not for iPhone 5

前端 未结 2 799
庸人自扰
庸人自扰 2021-01-23 12:35

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 somewh

相关标签:
2条回答
  • 2021-01-23 12:59

    If I am not wrong you didn't add any constraint to your label that's why it is not at center.

    Add this constraint for label.

    Result for all screen:

    0 讨论(0)
  • 2021-01-23 13:11

    i'm just adding video and setting constraints with rightclick on the outlet and selection done with left click

    this is tested in all the device so just watch and apply you can solve your problem and if you want to arrange your view so you can add new constraints which is required otherwise you can set these 4 constraints set and execute.

    just watch this video and setting your constraints

    you tube link to setting constraints in autolayout to centering button

    0 讨论(0)
提交回复
热议问题