Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Theme.Holo doesn't show Tabhost Widget icons

I'm using Theme.Holo as my parent theme for an application. However, the tabs in the tab host don't display icons. In order to display icons, I can change the theme to Theme.Light or just Theme, but then I won't have the action bar that comes with Theme.Holo.

Could someone please tell me how I could display icons on the tab host when using Theme.Holo? I'm referring to the iOS-like tab bar icons.

like image 977
Sorin Cioban Avatar asked Jan 01 '26 02:01

Sorin Cioban


1 Answers

Dont know if this solves your problem, but if you remove the text, the icon will be displayed.

This is the code I use:

TabHost tabHost = getTabHost();
Intent intent = new Intent().setClass(this, Overview.class);

spec = tabHost.newTabSpec("overview")
           .setIndicator(Build.VERSION.SDK_INT < 11 ? this.getString(R.string.descr) : "", res.getDrawable(R.drawable.tab_overview))
           .setContent(intent);
like image 133
Philipp E. Avatar answered Jan 02 '26 19:01

Philipp E.