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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -