Tabhost tab title size

warwound

Expert
Licensed User
Longtime User
You can also set the the size of the text labels (ie font size) with TabHostExtras.

Martin.
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Warwound: Since you developed tabhostextra, which is a tremendous library, are you working on making the indicator text of the selected tab a more noticeable color, instead of gray. Gray text usually depicts a control that is disabled or not selected. My workaround now is a bitmap in addition to the text that changes color as the tab is selected.
Thank you
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Well there are two options to change the tab text label color...

Take a look at the documentation for the Android TextView: TextView | Android Developers.

You can see that there are two setTextColor methods:

1) public void setTextColor (int color)

2) public void setTextColor (ColorStateList colors)

Updating TabHostExtras to use the first method would be quick and simple BUT i'm sure that the tab text labels would then display in whatever color is set in all states of the tab.
That is - the text color wouldn't change when the tab was selected or not selected.

So ideally i'd update TabHostExtras to use the second method.
To do that the developer would have to pass a ColorStateList object to TabHostExtras, B4A has no support for the ColorStateList object so i'd have to create a wrapper class within TabHostExtras so that the developer could create a ColorStateList object within B4A.

Here's the documentation for the Android ColorStateList class: ColorStateList | Android Developers.

You can see it's not very complicated but it's also not well documented - there's an XML based example but no Java based example.
If i could find some good Java based examples/tutorials i could probably get the ColorStateList wrapper coded and add the new method to TabHostExtras but i'm busy with other things and won't have time to spend on this for the time being.

It's on my list of things to do though so no doubt i'll get it done sometime..!

Martin.
 
Upvote 0

mikejohnsonharp

Member
Licensed User
Longtime User
You can also set the the size of the text labels (ie font size) with TabHostExtras.

Martin.

Hi Martin,
sorry for being a dult. I'm coming to you as the expert.
I'm trying to change the tabhost tabheight.
I followed what was written on the forum.
I've installed your library (well done, by the way!) ...
I've checked the "TabHostExtras" box in the library references
I've added Dim TabManager As TabHostExtras to Sub Globals
I've added TabManager.setTabHeight(tbhMain,30) to
Sub Activity_Create(FirstTime As Boolean)...
but the the tab height hasn't changed size.
Can you tell
Have I left anything out? or put something in the wrong place?
Mike
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
I'd guess 'put it in the wrong place' but can't say without seeing your code.

Can you export your project and upload it to this thread so i can take a look?

Martin.
 
Upvote 0
Top