How to set dynamically spacing between elements in UIStackView?

3k views Asked by At

How to with constrains set dynamically spacing between elements in UIStackView?

If I'll try to set spacing in Attribute inspector with IPhone 7 device, I'll get something like this:

XCode

But when I'll want to simulate it with IPhone 5 device, I'll get this:

IPhone5

My text will cropped. So how to get result with non-cropping text inside all elements? Thanks!

2

There are 2 answers

0
newca9h On BEST ANSWER

I've got it! Simply needed to add constraint to stackview of full page and set distribution to Fill and it's all! I spent couple days for that...

0
Joshua Wolff On

In my case, setting the stack view distribution to .equalSpacing worked.