Private Sub FontToFitMultiLine(lbl As Label, MaxSize As Float)
lbl.TextSize = MaxSize
Do While su.MeasureMultilineTextHeight(lbl, lbl.Text) > lbl.Height
lbl.TextSize = lbl.TextSize * 0.9
Loop
End Sub
Hi Erel, The title says the wish. Currently, there are three different routines in the class with different results. Example: MeasureTextHeight("Mg") and MeasureTextHeight("M") give different results in B4A because the real height is different, but give the same result in B4J. I have not checked...
Private Sub FontToFitMultiLine(lbl As Label, MaxSize As Float)
lbl.TextSize = MaxSize
Do While su.MeasureMultilineTextHeight(lbl, lbl.Text) > lbl.Height
lbl.TextSize = lbl.TextSize * 0.9
Loop
End Sub
Routines to adjust a label to fit its text/adjust text size to fit a label: * SizeToFitWidth - given a width (and using the label's font), adjust the label's height * SizeToFitHeight - given a height (and using the label's font), adjust the label's width * SizeFontToFit - given some text for the...
When you set the text of this custom label the text size is automatically modified to the largest possible size so that all the text is visible. To use this view in your project, you should take the AutoTextSizeLabel class from the attached example and add it to your project. You should then...
It is not recommented to use this class in B4J, the textsize is resetting without reasons... this class is based on the Original Class from @Erel. It works on B4A, B4I and B4J. I tested it with B4A and B4I. Notes: -XUI is needed Change log: - V1.0 Release - V1.1 Add RefreshView Add...