i try to figure out how to MeasureMultilineTextHeight for B4XFloatTextField but no luck,
B4A i can use StringUtils to get B4XFloatTextField height, but B4I try many way but still cannot get the correct height.
B4I
what the right way to measure the height for B4XFloatTextField?
B4A i can use StringUtils to get B4XFloatTextField height, but B4I try many way but still cannot get the correct height.
B4X:
su.MeasureMultilineTextHeight(TextField.TextField,"YOU ARE THE ROCK!!")
B4I
B4X:
getTextHeight("YOU ARE THR ROCK!!",Font.DEFAULT,txt_msg.TextField.Width)
B4X:
Sub getTextHeight(content As String,fo As Font,LbWidth As Float) As Float
Dim tmpString As String = "大"
Dim str() As String = Regex.Split(Chr(10),content)
Dim height As Float
Dim number As Int
Dim fontHeight As Float = tmpString.MeasureHeight(fo)
For Each s As String In str
number = s.MeasureWidth(fo)/LbWidth + 1
height = height + number*fontHeight
Next
Return height + fontHeight
End Sub
what the right way to measure the height for B4XFloatTextField?