我是android新手,我不知道如何定制TabView。任何人都可以指导我如何创建自定义tabview。
答案 0 :(得分:0)
您可以借助此代码更改标签视图的背景和图像
for(int i = 0; i
tabHost.setOnTabChangedListener(new OnTabChangeListener(){
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
for(int i=0;i<tabHost.getTabWidget().getChildCount();i++)
{
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(R.color.transparent); //unselected
}
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor("#000011")); // selected
}