0

I have difficulty to stretch all 5 buttons inside horizontal stack view as wide as my device width. Can I do that? or do you guys have any solutions?

Looking forward to your answer. Thank you very much for your attention.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
hallz13
  • 59
  • 7

3 Answers3

2
  • Add a Horizontal Stack View
  • Add Constraint - Center Vertically in container
  • Pin the stack view to the left and right view after unchecking constrain to margins.
  • Add or drag your buttons into the stack view.
  • Select your stack view in Document Outline, and then in Attribute Inspector change Distribution to Fill Equally.
  • Done![enter image description here]1
Martin Muldoon
  • 3,388
  • 4
  • 24
  • 55
1

If you have an horizontal stack view, set its constraints to left and right of the superview and the distribution to Fill Equally, so the buttons will fill the view in an equally way.

0

Simply select the five buttons, and add them to a stack view. Then pin the stack view to the left and right of the superview. The buttons will automatically span the entire view's horizontal space. See image below: enter image description here

Martin Muldoon
  • 3,388
  • 4
  • 24
  • 55