Table.getHeight () always returns 0, although it should not

I am trying to arrange and scale some elements inside a table, and I need to know the height of the table in order to achieve all this. The problem is that whenever I try to get its height, it always returns 0, although the table is clearly on the screen and has a certain size. Why is this?

table_height = table.getHeight();
+4
source share
1 answer

I suggest you use the pack () method in the table before calling getHeight (). This will set the height and width for your table.

table.pack();
table_height = table.getHeight();
+7
source

All Articles