tabhost.getCurrentTabView().setBackgroundColor(Color.CYAN); //设置默认选中状态的背景
tabhost.setOnTabChangedListener(new OnTabChangeListener() { @Override
public void onTabChanged(String tabId) {
for(int i = 0; i < tabWidge.getChildCount(); i++) { View tabView = tabWidge.getChildAt(i); if(tabhost.getCurrentTab() == i) { tabView.setBackgroundColor(Color.CYAN); } else { tabView.setBackgroundColo(Color.BLACK)); //未选中的颜色
}
}
}
});
tabhost.setOnTabChangedListener(new OnTabChangeListener() { @Override
public void onTabChanged(String tabId) {
for(int i = 0; i < tabWidge.getChildCount(); i++) { View tabView = tabWidge.getChildAt(i); if(tabhost.getCurrentTab() == i) { tabView.setBackgroundColor(Color.CYAN); } else { tabView.setBackgroundColo(Color.BLACK)); //未选中的颜色
}
}
}
});
mTabHost.setCurrentTab(0);
home_radio = (RadioButton) findViewById(R.id.home_radio);
home_radio.setChecked(true);
int[] hots=new int[]{R.drawable.red1,R.drawable.red1,R.drawable.red,R.drawable.red,R.drawable.red};
@Override
public void onTabChanged(String tabId) {
for (int i = 0; i < tabWidget.getChildCount(); i++) {
View vvv = tabWidget.getChildAt(i);
if (tabHost.getCurrentTab() == i) {
vvv.setBackgroundResource(hots[i]);
} else {
vvv.setBackgroundResource(R.drawable.match_bg_score);
}
}
}
});