I created the following layout:

The label on the right side, is included in a stackview, but is "clinging" to the right side of the screen when launching the app. I want to achieve some spacing, but don't know how to achieve it.
The expected output would look like this:

When isLayoutMarginsRelativeArrangement property is true, the stack view will layout its arranged views relative to its layout margins. So here,
stackView.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 20)
stackView.isLayoutMarginsRelativeArrangement = true
The above will add 20 pixels width of padding to the right edge of the stackview. This can also be done via the storyboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With