How do you determine the height of text after it's been ellipsized?
I'm trying to determine the height using StringUtils' MeasureMultilineTextHeight method but it gives me the height of the entire text
Any way to achieve this?
I'm trying to determine the height using StringUtils' MeasureMultilineTextHeight method but it gives me the height of the entire text
B4X:
Sub GetEllipsisHeight(Str As String) As Int
Dim l As Label:l.initialize("")
l.Text = Str.trim:l.Typeface = c.NormalFont:l.TextSize = 14
Ellip(l,"END",3)
Activity.AddView(l,10%x,0,80%x,-2) 'Displays text Ellipsis perfectly
Dim su As StringUtils
Dim ui As Int = su.MeasureMultilineTextHeight(l,l.Text)
Return ui 'Returns the height of the original text
End Sub
Sub Ellip(textview As Label,mode As String,lines As Int)
Dim jo = textview As JavaObject
jo.RunMethod("setEllipsize", Array As Object(mode))
jo.RunMethod("setLines", Array As Object(lines))
End Sub
Any way to achieve this?