Android Question TabHost Titles are always UpperCase

welu1805

Active Member
Licensed User
I added a tab to TabHost1:
TabHost1.AddTab("Playlists", "Playlists.bal")

The tab title on the android device is always UpperCase: PLAYLISTS.

Can I turn off "UpperCase"?

Thanks
Lutz
 

Mahares

Well Known Member
Licensed User
Until someone offers a better solution, can you try to assign a variable to the title like this and see if it works:
B4X:
Dim MyPlaylists as string ="Playlists"
TabHost1.AddTab(MyPlaylists, "Playlists")
 

Mahares

Well Known Member
Licensed User
I do not have the problem in my tabhost that you are having with yours, Try this:
TabHost1.AddTab("Playlists".ToLowerCase, "Playlists")
If this does not solve your problem, perhaps a more qualified forum user can offer the correct solution.
 

Erel

Administrator
Staff member
Licensed User
This is the how the default TabHost looks on Android 4+.

You can use this sub to disable this:
B4X:
Sub PreventUpperCase(th As TabHost)
   Dim p As Phone
   If p.SdkVersion >= 14 Then
     Dim jo As JavaObject = th
     Dim pnl As Panel = jo.RunMethod("getTabWidget", Null)
     For Each v As View In pnl.GetAllViewsRecursive
       If v Is Label Then
         Dim j As JavaObject = v
         j.RunMethod("setAllCaps", Array(False))
       End If
     Next
   End If
End Sub
Requires Phone and JavaObject libraries.
 
Top