我做了一个使用Tab Host的android应用程序,我想改变Tab Host的背景颜色,而不是使用 android 操作系统给予的默认颜色。
我上网查找的下面的方法:
for (i = 0; i < mTabHost.getTabWidget().getChildCount(); i++) {
mTabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.LTGRAY);
}
mTabHost.getTabWidget().getChildAt(mTabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#000000"));
但现在第一个tab的颜色可以改变,但是当我点击另外一个tab的时候,它的颜色没变。怎么修改呢?