layout:
- (UIView *)container
-
- (UIView *)item
-
-
- (UIView*)subItemsContainer
-
-
-
-
- (UIView *subItem
-
-
from the container I do:
UIView *someItemContentView = --code for an item goes here--;
[someItemContentView sizeToFit];
[self.item.subItemsContainer addSubView:someItemContentView];
[self.item.subItemsContainer sizeToFit];
[self.item sizeToFit];
[self sizeToFit];
However, the subItem is still clipped to it’s frame. Meaning the frame didn’t “size to fit”. Is this not the correct way to size all my views dynamically?
sizeToFitcallssizeThatFitsto determine the size to be used. But as the documentation says:Which basically means that the default implementation does nothing, and it is up to the subclasses to implement the appropriate
sizeThatFitsbehavior.