Lachtan
Lachtan

Reputation: 5172

Aligment in stack view

I'm using UIStackViews with UILabels in my project. Basically I have horizontal stack view and two labels inside. Alignment: Fill, Distribution: Fill proportionally. I'd expect that second label will be right after first one. But it's not.I tried various alignments but nothing worked. Any idea what I'm doing wrong?

iPhone screenshot: enter image description here

xib file:

enter image description here

Upvotes: 0

Views: 153

Answers (1)

Craig Siemens
Craig Siemens

Reputation: 13276

You screenshot doesn't show the constraints your using in your xib but I assume there is a constraint stating that the right/trailing side of your UIStackView should equal the right/trailing side of your view. If you change it so the UIStackView is <= your view, it should layout how you want.

Upvotes: 1

Related Questions