I have been following this guide: Resizing UITableView to fit content in order for the UiTableView to adjust its height after its content.
In the ViewDidLoad() method, I am filling my uiTable so it has 3 rows. So the content height should not be 0.
Do you have any ideas of what could be wrong?
This is my class:
public partial class ContentSizedTableView : UITableView
{
public ContentSizedTableView(IntPtr handle) : base(handle)
{
}
public override CGSize ContentSize { get => base.ContentSize; set => InvalidateIntrinsicContentSize(); }
public override CGSize IntrinsicContentSize
{
get
{
LayoutIfNeeded();
return new CGSize(NoIntrinsicMetric, ContentSize.Height);
}
}
}