How can I get the height of an iOSTable?

Hey all,

I have an iOSTable in a Container control. The iostable may vary in height depending on what is loaded into the table when it is presented. I want to set the height of the container to the height of the table. I can’t figure out how to get the height of the table. Right now the table has a constraint tying it to the height of the container control. But if I make the container control too small, then I have to scroll the table. If I make the container control too large there’s lots of blank space.

A picture is worth a thousand words. The first picture is when the table is too small. The second when it is too large.

Screen Shot 2020-08-29 at 11.41.13 AM

In this case, I want the container control to stop after “VGA”.

So how can I calculate the populated height? Is there a standard row height and header height for each section? What are those? It looks like it might be 50 pixels. Is that correct?

Thanks!

Actually the height of each row may vary automatically depending on length of text, pictures in rows, OS version and device (iPhone/iPad).

I use such a popup menu in one of my apps and use the following:
-fixed height rows using iOSCustomTableCell, set to 50px
-No header row in the iOSTable
-Container height set to 50 x RowCount

1 Like

Thanks @Jeremie_L. I’m not doing much with the tables and figured out the default height did seem to be about 50. I’m using that as my default but perhaps it’s better to do what you did and set a fixed height with a custom TableCell.

Thanks for the tip.

1 Like