iOS Question MeasureStringWidth for B4i ?

MitchBu

Well-Known Member
Licensed User
Longtime User
Is there any way to measure the width of a given string for a given font and size ?

I found the SizeToFit routines, but there does not seem to be the equivalent of the B4A canvas routine.
 

Star-Dust

Expert
Licensed User
Longtime 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)
 
Last edited:
Upvote 0
Top