I have a text component who’s text changes at runtime. When the number of lines in the text changes, is there a way to determine the render height of the text.
Is there an event raised when the text height changes?
I’d like to know the height, in order to set the height of the content in a scroll view, so the scrollbar scales appropriately or disappears.
There is a lineHeight and fontSize on the element component.
Is it one text element per line? Or one element with everything? During the parse, you could calculate the number of lines in the resulting JSON, multiply it by the lineheight and update the contents height.
Hmm, well, text element has a calculatedHeight property, which is the final height of the text element, e.g. considering multiple lines. I can’t remember when it gets updated, but maybe it can be used in your case.