There are many occasions when you need to have multiple labels which all size themselves to their contents and also align with each other with no space.
The solution to this is to use MeasureMultiLineText within the StringUtils Library.
To make this easy to use I created a CustomView...
Calculate width of Charsequence Text
Uses Java Function measureText(charSequence , int Start, int End)
' textSize is default textsize of label where charsequence is displayed
Sub getWidthofCS(cx As Object,textSize As Float) As Float
Dim jo As JavaObject = Me
Return...
LineUtils
Version: 1.2
Based on code by Erel for StringUtils function MeasureMultilineTextHeight
StringUtils function calculates the height for multiplier value 1 only.
With this function you can calculate height with variable line spacing.
LineUtils
Methods:
getMultilineHeight...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.