Resize text on tabHost

I am trying to make a tabHost with two tabs, it’s fine, but I want to change the size of the text, I searched a lot, but didn’t find anything without changing the whole layout of the tab, I just want to change the size of the text, do not change the background or something like that I add my tabs as follows:

tabHost.addTab(tabHost.newTabSpec("photos_tab").setIndicator(getString(R.string.userPhotos)).setContent(R.id.tab2)); 

when I try to put a TextView in setIndicator its work, and I can resize the text, but change everything, click, background and other things. Therefore, I want to change only the size of the text.

any ideas?

ps: I am not extending TabActivity, so I cannot change the theme in AndroidManifest or something like that. (I tried this before: How to change the tabhost font size in android )

Thanks.

+5
source share
1 answer

Yes, you can do this by getting the child in the specified position and receiving his textual representation and setting his text.

  TextView x = (TextView) tabHost.getTabWidget().getChildAt(0).findViewById(android.R.id.title); x.setTextSize(25); 
+23
source

All Articles