I have the following view tree:
StackView
- axis: vertical
- alignment: fill
- distribution: fill
- spacing: 0
- constraints:
- - - trailing space to: Superview
- - - leading space to: Superview
- - - top space to: Superview
- - - subviews:
- - - - - UIView (name: VIEW_ONE)
- - - - - - - constraints:
- - - - - - - - - height: 60
- - - - - - - subviews:
- - - - - - - - - UIView (name: VIEW_TWO)
- - - - - - - - - - - constraints:
- - - - - - - - - - - - - align center Y to: Superview
- - - - - - - - - - - - - trailing space to: Superview
- - - - - - - - - - - - - leading space to: Superview
- - - - - - - - - - - - - height: 20
obs: the StackView is inside a UIView that occupies the entire screen
It all works fine until I try to set the VIEW_ONE's hidden state to true. The Xcode UI starts complaing that the VIEW_TWO:
- Need constraints for: Y position or height;
- Need constraints for: X position or width.
Why is that happening? I tried a lot of things to solve that problem, but nothing worked out =/

stackViewcontains only one subview, why have you usedstackViewthen. Your second view is a subview of your first view as I can see. - iPeterstackView. - iPeter