I'd like to ask you if it's possible to set height in percentage of each container placed in vertical stack view? I want to have 3 containers in stack view. First should take 40% of screen size, second 20% and third 40%. Thank you
'Fill proportionally' distribution type works with intrinsic content size.
So if our vertical stack(height say 600) view has 2 views, ViewA (intrinsic content height 200) and ViewB(intrinsic content height 100), the stack view will size them to ViewA(height 400) and ViewB(height 200).
What you really want
is the 'fill' type distribution with two constraints.
Thats all. Hope it helps.
To set container's height dynamically, you can use screen size with code like this
let screenSize: CGRect = UIScreen.mainScreen().bounds self.firstContainer.view.frame = CGRectMake(0, 0, screenSize.width, screenSize.height * 0.4) self.secondContainer.view.frame = CGRectMake(0, self.firstContainer.view.frame.origin.y + screenSize.height *0.4, screenSize.width, screenSize.height * 0.2) self.thirdContainer.view.frame = CGRectMake(0, self.secondContainer.view.frame.origin.y + screenSize.height *0.2, screenSize.width, screenSize.height * 0.4)