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.
See post #3 for more information on the supported versions.
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.
B4X:
#AdditionalJar: com.android.support:support-compat
Sub SetAutoSizeBasedOnText(v As View)
Dim jo As JavaObject
jo.InitializeStatic("android.support.v4.widget.TextViewCompat")
jo.RunMethod("setAutoSizeTextTypeWithDefaults", Array(v, 1))
End Sub
See post #3 for more information on the supported versions.
Last edited: