I have this views hierarchy in a xib
file:
UIView
UIScrollView
UIView
UIView
UITableView
UIButton
Let's call contentView
the UIView
that is the direct child of the UIScrollView
. I've set its top, bottom, leading and trailing constraints to pin the scroll view. Then, since I'm populating the table view at runtime and I don't know its height beforehand, I set the scroll view's contentSize
in code:
[self.scrollView setContentSize:CGSizeMake(self.contentView.frame.size.width, self.tableView.frame.size.height)];
But I don't make this work... what could I be missing?