how to set color to tab in android? -
i trying below code not work properly
public static void settabcolor(tabhost tabhost) { for(int i=0;i<tabhost.gettabwidget().getchildcount();i++) { tabhost.gettabwidget().getchildat(i).setbackgroundcolor(color.parsecolor("#ff0000")); //unselected } tabhost.gettabwidget().getchildat(tabhost.getcurrenttab()).setbackgroundcolor(color.parsecolor("#0000ff")); // selected }
i want change default color of tab.
thank in advance
tabhost tabhost = gettabhost(); for(int i=0;i<tabhost.gettabwidget().getchildcount();i++) { relativelayout tv = (relativelayout ) tabhost.gettabwidget().getchildat(i).findviewbyid(android.r.id.title); tv.setbackgroungcolor(.....); }
just use this...hopes works
Comments
Post a Comment