Reputation: 175
I have a UIStackView
constrained within a basic UIView
to fill the whole space. The stack view axis is vertical, the Alignment is Fill
and the Distribution is Fill Equally
.
I've added two container views and set their background colors to be red & green respectively.
All I want is for each subview to fill up half of the space vertically, but for whatever reason it keeps coming out like so:
The container view mode is Scale To Fill
.
Any ideas? Thanks a lot!
Upvotes: 1
Views: 844
Reputation: 175
Aha, it was due to Size Classes
. I was set to Compact
when I created the view and the containers. When I switched back to the base size class (Any, Any), the UIStackView
was greyed out. So I rebuilt it from scratch it now it works.
I hope this helps someone else!
Upvotes: 1