I can't seem to get the hang of this resizing superview.
I have a UIView *superview
with 4 UILabels
. 2 function as header for the 2 others.
The content in all 4 are dynamic coming from database.
SizeToFit
vs SizeThatFits:(CGSize)
vs UIView systemLayoutSizeFittingSize:
, passing either UILayoutFittingCompressedSize
or UILayoutFittingExpandedSize
.
I use autolayout programatically and have set the superview height to be equal or greater to a dummy number.
Where and how do I use these SizeToFit
vs sizeThatFits:(CGSize)
vs UIView systemLayoutSizeFittingSize:
, passing either UILayoutFittingCompressedSize
or UILayoutFittingExpandedSize
. I have read a lot of tips here on stack but ended up with nothing.
Do I need to recalculate the constraints for the superview somewhere specific. Maybe setting the height to be @property
in its controller class and remove and readd it?
Atm I have tried to put everything everywhere and then some. Still I get the same size end result with the dummy height and text floating outside. Even after setting clipsToBound on subview.