-2
イム、私は、ユーザーがタブアイコン/色]タブボタンをタブのレイアウトタブの色を変更しますか?アンドロイドStudioアプリの作成
変更をクリックしたときに、これは私のコードであるとします
tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
int id= tabHost.getCurrentTab();
// TabLayout.setSelectedTabIndicatorColor(int color); // Error because of non static method
// if(id==0){
// TabHost.TabSpec tab1spec = tabHost.newTabSpec("List");
// tab1spec.setIndicator("", getResources().getDrawable(R.drawable.home2));
// }
// if(id==1){
// TabHost.TabSpec tab1spec = tabHost.newTabSpec("Config");
// tab1spec.setIndicator("", getResources().getDrawable(R.drawable.lab2));
// }
// if(id==2){
// TabHost.TabSpec tab1spec = tabHost.newTabSpec("More");
// tab1spec.setIndicator("", getResources().getDrawable(R.drawable.more2));
// }
}
});
任意のアイデア?
おかげ
それがうまく働いたおかげで、 – Disco4uf