1
当前代码显示所选选项卡的颜色。我想将其改为现在显示图像。注释掉的代码是我认为会起作用的,不知道为什么它不会。它应该是什么?Android选项卡,如何显示选定选项卡的图像
非常感谢。
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
for(int i=0;i<mTabHost.getTabWidget().getChildCount();i++)
{
TabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#404040"));
//what I thought would work is this below ?????
//mTabHost.getTabWidget().getChildAt(i).getResources().getDrawable(R.drawable.tabimg);
}
mTabHost.getTabWidget().getChildAt(mTabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#271B1B"));
}
我错过了什么。 Thx再次。