I need help, I\'m finding difficulty for change background color in a TabHost.
Original Image:
Solution is to use background with selector, and the code is here:
private void initTabsAppearance(TabWidget tabWidget) {
// Change background
for(int i=0; i < tabWidget.getChildCount(); i++)
tabWidget.getChildAt(i).setBackgroundResource(R.drawable.tab_bg);
}
Where tab_bg is an xml drawable with selector:
For the full Tab customization I will add the code for changing tab text style using custom theme. Add this to styles.xml:
To use this theme, define it in AndroidManifest.xml:
And now you have tab widgets with custom background and custom text style.