// light theme support final TabHost tabHost = getTabHost(); tabHost.setBackgroundColor(Color.WHITE); tabHost.getTabWidget().setBackgroundColor(Color.BLACK); // hack to set font size LinearLayout ll = (LinearLayout) tabHost.getChildAt(0); TabWidget tw = (TabWidget) ll.getChildAt(0); // first tab RelativeLayout rllf = (RelativeLayout) tw.getChildAt(0); lf = (TextView) rllf.getChildAt(1); lf.setTextSize(21); lf.setPadding(0, 0, 0, 6); // second tab RelativeLayout rlrf = (RelativeLayout) tw.getChildAt(1); rf = (TextView) rlrf.getChildAt(1); rf.setTextSize(21); rf.setPadding(0, 0, 0, 6);
Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost Intent intent = new Intent(this, a0.class); tabHost.addTab(tabHost.newTabSpec("") .setIndicator("", res.getDrawable(R.drawable.ic_tab_main)) .setContent(intent)); Intent intent2 = new Intent(this, c0.class); tabHost.addTab(tabHost .newTabSpec("") .setIndicator("", res.getDrawable(R.drawable.ic_tab_setup)) .setContent(intent2)); Intent intent3 = new Intent(this, d0.class); tabHost.addTab(tabHost .newTabSpec("") .setIndicator("", res.getDrawable(R.drawable.ic_tab_third)) .setContent(intent3)); Intent intent4 = new Intent(this, e0.class); tabHost.addTab(tabHost .newTabSpec("") .setIndicator("", res.getDrawable(R.drawable.ic_tab_setting)) .setContent(intent4)); tabHost.setCurrentTab(0); // Set tabs Colors tabHost.setBackgroundColor(Color.BLACK); tabHost.getTabWidget().setBackgroundColor(Color.BLACK);
tabHost.setBackgroundColor(Color.WHITE); tabHost.getTabWidget().setBackgroundColor(Color.DKGRAY);
tabHost.setBackgroundColor(Color.WHITE); tabHost.getTabWidget().setBackgroundColor(Color.BLACK);