1

I have a vertical stack view with 3 views. I want my second view to be fixed (height) and the top and the bottom view to take all remaining space (and so that the second view will be centered...)

I've tried putting my top and bottom view with vertical content hugging priority to 251 and the middle view to 250 but nothing...

In other words, what's the equivalent for "weight" in android for swift...

Txs a lot!

Hiromi
  • 209
  • 1
  • 3
  • 12

1 Answers1

2

You can do this by adding a Height Constraint to the Bottom view, equal to the Height of the Top view.

Stack View settings:

enter image description here

Constraints:

enter image description here

Result:

enter image description here

DonMag
  • 69,424
  • 5
  • 50
  • 86
  • Oh man this is so nice... I was searching for weeks... and it was as simple as that! This will for sure help other people... Txs a lot! – Hiromi Sep 12 '19 at 15:30