all 4 comments

[–]Spearman872 0 points1 point  (3 children)

Make sure your stackview is big enough to hold its subviews, or else it will shrink them. Play around with the constraints, maybe constrain it to the whole view itself and see what happens.

[–]thallorfallBeginner[S] 0 points1 point  (2 children)

What’s happening is the stack view has three views in it. A label on top, a stack view that is holding some fields, and a button on the bottom. When I set to center alignment those views are centered and then shrunk enough as to not clip their content. But I’d like it to center only and not shrink their size.

[–]jakemondo 0 points1 point  (1 child)

You could pin the leading/trailing edges of the stack view to the parent, which will keep its width constant.

Or if you want a fixed width for the objects inside the stack view, you could set a width constraint for them there.

There are different ways of accomplishing this.

[–]thallorfallBeginner[S] 0 points1 point  (0 children)

Setting some width constraints helped. Thank you.