On the storyboard, inside a view controller I have a scrollview. A navigation bar and a stack view are embedded inside the scrollview. Programmatically I am adding some UI elements one below the other inside the stack view.
Via storyboard, constraints of the scrollview are set to the same as safe area - top, bottom, leading, trailing and width.
Navigation bar constraints - trailing, leading, top, width are same as super view.
Stackview constraints - trailing, leading, bottom, width are same as superview.
Navigation bar's bottom is same as stackview's top so that they are one below the other.
After setting these constraints, there is an error about scrollview - need constraints for: Y position or Height
Since the UI elements are being added dynamically to the stackview, How do I set the height in storyboard? Is there a better way to do this?
I tried "add missing constraint" option and it adds a constant height to the stack view which does not work well for all devices. Any help is appreciated since I am new to iOS app development. Thanks.


