Hi @SuperSimon, I've been working on a similar issue this morning. What I used to do was to put a label in each gallery row that held the height of that row, usually by adding the bottommost element's Y and Height properties (along with a bottom offset if necessary). Then I would put the following in the Height property:
/* For a gallery, galMyGallery, and label to calculate the height of each gallery row, lblRowHeight */
Sum(
galMyGallery.AllItems,
Value(lblRowHeight.Text)
)
I came back today after a week off and found that using this gives an error now. The label for the row height works but the sum function returns the error.
What seems to be working is to put that same formula in a label outside of the scrollable gallery (i.e. somewhere on the screen itself) and then reference the value of that label in the Height property. I'm not sure why it matters now where that formula is but apparently it does matter.
And for the record, using
CountRows(Self.AllItems) * Self.TemplateHeight
seems to use the Height of the first row of the gallery, which can work if that happens to be the tallest row but isn't so great otherwise. A great suggestion though @Anonymous!
Feel free to let me know how that works for you or if I can clarify anything! Cheers!