简体   繁体   中英

Resize UIView in XIB depending on subviews size

I have a layout (see image) made out of a few stack views embedded in each other, which are all subviews of the big pink UIView and I wanted to know how to automatically size the big pink UIView depending on the contents of it since the three labels in the middle stack view may become multiline in the future (the whole view's width is constant). Thanks!

Image of layout:

在此处输入图片说明

Never mind, turns out the view does size itself already, because I constrained the height of the button and the little title stack view at the top and not the middle stack view. Don't really know how this works, but it does!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM