Now I had the same problem another time. If I put the table height calculation in viewWillAppear , how does it work:
public override void ViewWillAppear (bool animated) { base.ViewWillAppear (animated); TableView.LayoutIfNeeded (); this.PreferredContentSize = new SizeF (320f, TableView.ContentSize.Height); }
The code is in C #, but you can easily convert it to Objective-C or Swift.
source share