目前我在Android应用程序中工作,使用TabHost设置五个标签,然后我尝试在标签栏中添加图标,但我不知道,如何设置它?请帮我
提前致谢
我试过这里提到供您参考:
//firstTab.setIcon(R.drawable.help);
//firstTab.setIconSelected(R.drawable.help_selected);
TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("1").setContent(new Intent(this, First.class)));
tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("2").setContent(new Intent(this, Second.class)));
tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("3").setContent(new Intent(this, Third.class)));
tabHost.addTab(tabHost.newTabSpec("tab4").setIndicator("4").setContent(new Intent(this, Fourth.class)));
tabHost.addTab(tabHost.newTabSpec("tab5").setIndicator("5").setContent(new Intent(this, Fifth.class)));
tabHost.setCurrentTab(2);