3
目前我可以在Android應用程序工作,使用TabHost設置五個選項卡,然後我試圖在標籤欄內添加圖標,但我不知道,如何設置它?請幫我如何在Android中的Tabbar中添加圖標?
由於提前
我試圖在這裏,供大家參考提到:
//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);
感謝您的回覆,現在我確認它儘快回覆您。 – SampathKumar
非常感謝,它的工作很好。 – SampathKumar