I need a method of determining the height of each row in a TableView
. As you can in the snapshot see below the height of each row vary.
So why do I want to achieve this?
I've got to take the items from an existing TableView
and have them placed in other temporary tables so that the number of items in those can fit in exactly without the need for the vertical scrollbars. The temporary tables have got a fixed height of 490. So say that the existing TableView
has got 50 items, then the maximum number rows a temporary table can have is 24(I tested this before) given that each row in the existing TableView has only a single line of text. But when there multiples lines of text in the rows, then the maximum number of rows a temporary table can have will differ.
So, the solution I came up with was sum the heights of the rows when being placed in the temporary tables. If the total height gets close to the temporary tables' fixed height(i.e. 490), stop adding items to that table. Then create another temporary table and add the remaining items to that one. Hence, the question "how do I get the height of a single row"?