I am creating an expandable view control which I would like to expand to the size of the child controls, however if I try to use the sizeToFit method nothing happens and sizeThatFits simply returns the current views size
Any suggestions?!?
I am creating an expandable view control which I would like to expand to the size of the child controls, however if I try to use the sizeToFit method nothing happens and sizeThatFits simply returns the current views size
Any suggestions?!?
You'll have to do this yourself in a subclass. It's difficult for UIView to do automatically because views can be in any position and often overlap, and there are obvious corner cases:
+--+ +-+
|A | |A| +--+
| B| could become |B| or |AB|
+--+ +-+ +--+