0
當我點擊標籤欄更改標籤
public class ZoobuzzActivity extends TabActivity implements OnTabChangeListener {
/** Called when the activity is first created. */
TabHost tabHost;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_tab);
}
public void onTabChanged(String tabId) {
for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.RED);
}
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.GREEN);
}
}
請幫助我,我想改變顏色,當標籤選擇改變
我的方法onTabChanged()沒有被調用。