-1

Anyone please suggest which contraint combination is best for getting this desired output. It must be suitable for both iPad and iPhones. First I set the label To in the center of the container and set contrainst for all other controls based on that. But the problem is there are lot more space left and the design looks not good.

SIDHARTH P U
  • 282
  • 1
  • 14

1 Answers1

2

I would have one Horizontal UIStackView with Distribution Fill Equally and inside I would put two horizontal UIStackViews with Distributions Fill. Inside each I would put UILabel and then UITextField.

Spacing between label and text field (or between stack views) you can set by setting spacing of its related stack view. Or you can set distribution to Fill Proportionally and then set aspect ratio for label and text field widths

enter image description here

So, constraints which you need are constraints for main stack view.

Community
  • 1
  • 1
Robert Dresler
  • 10,580
  • 2
  • 22
  • 40