TabHost = (TabHost) findViewById (android. R. id.Tabhost); // Obtain the TabHost object TabHost. setup (); // initialize the TabHost component LayoutInflater inflater = LayoutInflater.From(This); // Declare and instantiate a LayoutInflater object // Begin to add more tab. Inflater. inflate (R. layout.Tab1, TabHost. getTabContentView ()); Inflater. inflate (R. layout.Tab2, TabHost. getTabContentView ()); Inflater. inflate (R. layout.Tab3, TabHost. getTabContentView ()); Inflater. inflate (R. layout.Tab7, TabHost. getTabContentView ()); // Inflater. inflate (R. layout. tab4, tabHost. getTabContentView ()); TabHost. addTab (tabHost. newTabSpec ("tab01 ") . SetIndicator ("SET ") . SetContent (R. id.LinearLayout01); // Add the first tab TabHost. addTab (tabHost. newTabSpec ("tab02 ") . SetIndicator ("VID6X ") . SetContent (R. id.LinearLayout02); // Add the second tab TabHost. addTab (tabHost. newTabSpec ("tab03 ") . SetIndicator ("VID2X-7X ") . SetContent (R. id.LinearLayout03)); TabHost. addTab (tabHost. newTabSpec ("tab04 ") . SetIndicator ("CCD-TEST ") . SetContent (R. id.LinearLayout07)); // TabHost. addTab (tabHost. newTabSpec ("tab04 ") //. SetIndicator ("DASHBOARD ") //. SetContent (R. id. LinearLayout04 )); /* Tab title height */ /* TabHost. getTabWidget (). getChildAt (0). getLayoutParams (). height = 75; TabHost. getTabWidget (). getChildAt (1). getLayoutParams (). height = 75; TabHost. getTabWidget (). getChildAt (2). getLayoutParams (). height = 75; TabHost. getTabWidget (). getChildAt (3). getLayoutParams (). height = 75 ;*/ |