host.setOnTabChangedListener(new OnTabChangeListener(){
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
for(int i=0;i<host.getTabWidget().getChildCount();i++)
{
host.getTabWidget().getChildAt(i).setBackgroundColor(Color.TRANSPARENT); //unselected
}
host.getTabWidget().getChildAt(host.getCurrentTab()).setBackgroundColor(Color.CYAN); // selected
}
});
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
for(int i=0;i<host.getTabWidget().getChildCount();i++)
{
host.getTabWidget().getChildAt(i).setBackgroundColor(Color.TRANSPARENT); //unselected
}
host.getTabWidget().getChildAt(host.getCurrentTab()).setBackgroundColor(Color.CYAN); // selected
}
});
No comments:
Post a Comment