JAVA Program section:
Setcontentview (R. layout. index); tabhost = (tabhost) findviewbyid (R. id. tabhost); // If tabactivity is not inherited, use this method to load and start tabhost. setup ();/* tabhost. addtab (tabhost. newtabspec ("tab1 "). setindicator ("", getresources (). getdrawable (R. drawable. icon5 )). setcontent (R. id. HQ); tabhost. addtab (tabhost. newtabspec ("tab2 "). setindicator ("", getresources (). getdrawable (R. drawable. icon1 )). setcontent (R. id. ZX); tabhost. addtab (tabhost. newtabspec ("tab3 "). setindicator ("", getresources (). getdrawable (R. drawable. icon7 )). setcontent (R. id. JY); tabhost. addtab (tabhost. newtabspec ("tab4 "). setindicator ("", getresources (). getdrawable (R. drawable. item_web )). setcontent (R. id. TS); tabhost. addtab (tabhost. newtabspec ("tab5 "). setindicator ("", getresources (). getdrawable (R. drawable. item_system )). setcontent (R. id. XT); * // * tabhost. addtab (tabhost. newtabspec ("tab1 "). setindicator ("", getresources (). getdrawable (R. drawable. icon5 )). setcontent (new intent (this, hqactivity. class); tabhost. addtab (tabhost. newtabspec ("tab2 "). setindicator ("", getresources (). getdrawable (R. drawable. icon1 )). setcontent (new intent (this, zxactivity. class); tabhost. addtab (tabhost. newtabspec ("tab3 "). setindicator ("", getresources (). getdrawable (R. drawable. icon7 )). setcontent (new intent (this, jyactivity. class); tabhost. addtab (tabhost. newtabspec ("tab4 "). setindicator ("", getresources (). getdrawable (R. drawable. item_web )). setcontent (new intent (this, tsactivity. class); tabhost. addtab (tabhost. newtabspec ("tab5 "). setindicator ("", getresources (). getdrawable (R. drawable. item_system )). setcontent (new intent (this, xtactivity. class); */tabwidget = (tabwidget) tabhost. gettabwidget (); tabwidget. setbackgroundresource (R. drawable. redbutton); For (INT I = 0; I <tabwidget. getchildcount (); I ++) {/* can be used to set the font of the text. In this example, the image already contains text */textview = (textview) tabwidget. getchildat (I ). findviewbyid (Android. r. id. title); textview. settextsize (14); textview. setpadding (0, 3, 0, 0); // used to set the image height and width imageview image = (imageview) tabwidget. getchildat (I ). findviewbyid (Android. r. id. icon); image. getlayoutparams (). height = 50; // you can solve the problem image by assigning values to its attributes. getlayoutparams (). width = 50 ;}