I use the entire code shown below to adjust the text size of the label to fit a smaller label width, but it is not working for me. If it is working for you then my problem lies in this line: #AdditionalJar: com.android.support:support-compat
What am I suppose to download or change? I have SDK manager 3.29. My Android.jar is: C:\Android\platforms\android-27\android.jar
Thank you
What am I suppose to download or change? I have SDK manager 3.29. My Android.jar is: C:\Android\platforms\android-27\android.jar
Thank you
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#AdditionalJar: com.android.support:support-compat
Sub Process_Globals
End Sub
Sub Globals
Private lblDesc As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
lblDesc.Initialize("")
Activity.AddView(lblDesc,20%x,20%y,150dip,40dip)
lblDesc.TextColor=Colors.Red
lblDesc.Text="This is a quite long text to fit label width by reducing it text size"
SetAutoSizeBasedOnText(lblDesc)
End Sub
Sub SetAutoSizeBasedOnText(v As View)
Dim jo As JavaObject
jo.InitializeStatic("android.support.v4.widget.TextViewCompat")
jo.RunMethod("setAutoSizeTextTypeWithDefaults", Array(v, 1))
End Sub