02-15-2019 12:24 - edited 02-15-2019 12:34
02-15-2019 12:24 - edited 02-15-2019 12:34
Hi, I need to get the height of a textarea, in pixels or in number of lines. Is that possible? I looked at the getBBox.height, but it returns 0 right after I set the text property. Is there an event I can hook into during rendering, where I can get the height, or is there another way to get it?
Just to add some context: I have a Virtual Tile List, where each item contains a panorama view, which allows for swipe-like options.
Inside the panorama view, I have a textarea and another text element. The text in the textarea can vary in length, so the number of lines and thus the height of the textarea is not fixed. So I need to manually set the height of the enclosing tile element. Currently I estimate the number of lines from the number of characters in the textarea. This works fine most of the time, but once in a while the tile item becomes too short or too long. If I could know the exact height of the textarea, this would solve the problem completely. I've tried with a Dynamic Textarea, but then the screen for some reason gets totally garbled.
Thanks,
Jon