Change Android TabWidget bottom bar color
Solution 1
I'm guessing that "bottom bar" refers to the optional horizontal line that separates the tabs and the content. Take a look at the various tabStrip attributes described in the TabWidget API doc. You can set different drawables for the left and right parts of the strip.
Solution 2
See:
to enable/disable this line:
tabHost.getTabWidget().setStripEnabled(boolean);
to set drawable at left for this line:
tabHost.getTabWidget().setLeftStripDrawable(drawable);
to set resourse at left for this line
tabHost.getTabWidget().setLeftStripDrawable(resId);
to set drawable at right for this line:
tabHost.getTabWidget().setRightStripDrawable(drawable);
to set resourse at right for this line:
tabHost.getTabWidget().setRightStripDrawable(resId);
Kenny Ma
Updated on June 04, 2022Comments
-
Kenny Ma almost 2 years
How do I change the color of the bottom bar for TabWidget? I have successfully changed the tab background color but the bottom bar is still grey/orange and I couldn't find any info in the Android doc and source regarding this. Thanks.