B4J Question Get Label height b4j

hi all,
I set a long text to my label in b4j. and i want to get text height.
In b4a i use 'StringUtils' Library but in b4j 'JStringUtils' Library dosn't have MeasureMultilineTextHeight!
what should i do?
 

Star-Dust

Expert
Licensed User
use B4XCanvas.MeasureText to measure height and width in cross platform

B4X:
Dim Rec As B4XRect = Can.MeasureText(txt,xui.CreateDefaultFont(dt))
log(Rec.Width)
log(Rev.Height)
 
Top