My question is more or less similar to this question, but the response approved as the answer for the same doesn't solve my issue.
I'm implementing tab structures using the FragmentTabHost
class. When the tab background color is not explicitly specified, the tab indicator line seems to appear as Android
provides. But when I programatically change the tab's background color, the tab indicators disappear (hidden).
Currently, I assign the tab background color this way :
private void customizeTabbs() {
for (int i = 0; i < mTabHost.getTabWidget().getTabCount(); i++) {
View tabChild= mTabHost.getTabWidget().getChildAt(i);
..
..
tabChild.setBackgroundResource(someColorResource);
}
}
I also tried to change the background color in the XML
way by adding to styles.xml
, following this as:
<item name="tabBackground">@color/someColor</item>
<item name="tabIndicatorColor">?@color/someOtherColor</item>
The solution suggested for one similar question also did not help me.