Hi, is it possible to fit the text to the EditText size?
I would also be happy if the part that doesn't fit could be cut off, as long as what does fit is displayed correctly.
I've tried AutoTextSizeLabel (I can also use a Label) but I need to change the width on execution depending on certain user preferences. And AutoTextSizeLabel doesn't have a "Width" property.
Thanks.
This is based on a nice new feature in Android Support library. It automatically adjusts the view's text size to make it fit. You can call it with any of the following views: Label, Button, CheckBox, RadioButton, ToggleButton Note that the size will change whenever you set the text...
Sub SetLabelTextSize(lbl As Label, txt As String, MaxFontSize As Float, MinFontSize As Float)
Dim FontSize = MaxFontSize As Float
Dim Height As Int
Dim stu As StringUtils
lbl.TextSize = FontSize
Height = stu.MeasureMultilineTextHeight(lbl, txt)
Do While Height > lbl.Height And FontSize > MinFontSize
FontSize = FontSize - 1
lbl.TextSize = FontSize
Height = stu.MeasureMultilineTextHeight(lbl, txt)
Loop
End Sub
This is based on a nice new feature in Android Support library. It automatically adjusts the view's text size to make it fit. You can call it with any of the following views: Label, Button, CheckBox, RadioButton, ToggleButton Note that the size will change whenever you set the text...
Hello, it seems that this option is only valid for android 8+.
Anyway, I'll keep it in mind for later. For when my customers upgrade their devices.
Thank you.