How to align two buttons equidistance from the centre of the UIView

后端 未结 3 1874
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 07:29

I am working with auto layout . Facing on interesting issue . Fortunately overcame from it for the time but need to know the best way to solve it .

3条回答
  •  别那么骄傲
    2021-02-06 08:07

    I faced the same problem. I resolved using the idea i got from rdelmar's answer.

    This is what I did.

    For left button:

    1. Added the constraint to 'Center - Horizontally in container'
    2. Then changed the multiplier to 0.5 instead of 1 for that constraint.

    For right button:

    1. Added the constraint to 'Center - Horizontally in container'
    2. Then changed the multiplier to 1.5 instead of 1 for that constraint.

    Let me know if it worked for you.

提交回复
热议问题