I have a vertical stack view which can contain 1-3 subviews. The subviews should have height about 1/3 of stack view height, even when there's only one or two of them.
I tried adding:
view.heightAnchor.constraint(equalTo: stack.heightAnchor, multiplier: 0.3)
but it throws a constraint conflict, because stack view pins a subview to top and bottom.
Is there a way to do this with UIStackView
?