B4J Question Get Label height b4j

alirezahassan

Active Member
Licensed User
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)
 
Upvote 0
Top