Let's_Create
Let's_Create

Reputation: 3643

How to solve Layout issues with nested StackViews?

I am getting a few layout issues while taking a 3-D view of the UI designed.

So this is the View where there is one Vertical StackView and within it a list of stackView. Ex-

enter image description here

As you can see in the above image there are 4 internal stack views and here are the constraints for all the elements within it.

enter image description here

Everything looks good on UI but when I take a 3-D view of above I am getting layout issues. Though I can understand giving the constant stackView height to all will fix it but as the text is dynamic I can't have a constant height.

enter image description here

Upvotes: 0

Views: 571

Answers (1)

DonMag
DonMag

Reputation: 77690

Here is a layout that does not generate any layout warnings / ambiguities:

enter image description here

The stack views' properties are set as follows:

enter image description here

enter image description here

enter image description here

I designed one "Row Stack" in the Vertical "Outer Stack" and then just duplicated it 3 times.

Here is how it looks at run-time (labels have background colors to make it easy to see their frames):

enter image description here

and with the label backgrounds set to clear:

enter image description here

Upvotes: 1

Related Questions