1

My layout has a UIStackView which has multiple child stack views. The parent and child stackviews both have heightConstraint set. On a button tap I collapse the parent stackview to a certain height. But while collapsing, the parent stackview's content i.e child stackviews shrink.

self.summaryStackViewHeightConstraint.constant = self.summaryStackViewHeight 

Can anyone please help me with how to set parent stackview height constraint without shrinking its content.

Thanks in advance

  • if you are using stackview, instead of setting height constraint, hide/unhide child's stackview when you are collapse/expand your parent stackview. it will automatically calculate it's height based on its content. – seto nugroho Dec 11 '17 at 07:32

0 Answers0