自定义标签
private TabHost.TabSpec buildTagSpec(String tagName, int tagLable, int icon, Intent content) { return tabHost .newTabSpec(tagName) .setIndicator(getResources().getString(tagLable), getResources().getDrawable(icon)).setContent(content); }
private void addSpec() { tabHost.addTab(this.buildTagSpec("tab_system", R.string.system, R.drawable.menu_about_icon, system_Information_intent)); tabHost.addTab(this.buildTagSpec("tab_hardware", R.string.hardware, R.drawable.menu_map_icon, hardware_Information_intent)); tabHost.addTab(this.buildTagSpec("tab_software", R.string.software, R.drawable.menu_forum_icon, software_Information_intent)); tabHost.addTab(this.buildTagSpec("tab_runtime", R.string.runtime, R.drawable.menu_service_icon, runtime_Information_intent)); }
试试看吧,^_^ 要是效果没出来,我给你发整个代码