Ufuk Köşker
Ufuk Köşker

Reputation: 1470

How can I set the horizontal stackView according to the width of the first label

How can I align the stackview according to the content of the first label on storyboard ?

enter image description here enter image description here

Upvotes: 0

Views: 1050

Answers (2)

Shehata Gamal
Shehata Gamal

Reputation: 100503

Select the left label and then from size inspector change horizontal Content Hugging Priority = 1000

enter image description here

Upvotes: 1

DarkDust
DarkDust

Reputation: 92306

Make sure the horizontal Content Hugging Priority of your left label has a higher value than the one on the right. The exact values don't matter, but the left one must be at least 1 higher than the one on the right. For example, use "Default High (750)" on the left and "Default Low (250)" on the right.

Upvotes: 2

Related Questions