[Solved] Auto-layout issue


Updated

For Specific Ratio : To my understood, We can give Multiplier for Centre Vertically Constraints. Here ratio of top and bottom space will be same in all iPhone series. I gave Multiplier as 1.4

enter image description here

==================================

I know having several answers there. But, no one used UIStackView to add two simple buttons.

Drag two UIButton, select that two UIButtons, click Embed in Stack icon from here.

enter image description here

Stackview Properties

Give following things for UIStackView,

Set Axis as Horizontal, Distribution as Fill Equally, Spacing as 10 in Attributes Inspector

enter image description here

Stackview Constraints 1

Give constraints for that UIStackView, Check/Uncheck Margins, Left and Right = 0, Height as 30.

enter image description here

Stackview Constraints 2

Still, some constraints are not satisfied. Press Control and hold it, Click StackView and Drag to SuperView, you will get black pop up. Choose Center Vertically in container.

enter image description here

Stackview Constraints Customization

If you want to change height of UIButton or Bottom Space, click UIStackView and in Size Inspector, you can change height or move up/down.

enter image description here

13

solved Auto-layout issue