我想下面的代碼,但不能正常工作如何在android中將顏色設置爲選項卡?
public static void setTabColor(TabHost tabhost) {
for(int i=0;i<tabhost.getTabWidget().getChildCount();i++)
{
tabhost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FF0000")); //unselected
}
tabhost.getTabWidget().getChildAt(tabhost.getCurrentTab()).setBackgroundColor(Color.parseColor("#0000FF")); // selected
}
我想改變我的選項卡的默認顏色。
預先感謝
http://stackoverflow.com/questions/5577688/android-change-tab-text-color-programmatically ?rq = 1 – Ilan
此代碼給出錯誤 –