Bonjour tout le monde, j'ai un bug graphique sur une tabwidget. Je ne parviens pas à determiner l'origine de ce problème.
En fait, lorsque je change d'onglet, une barre blanche apparait.
http://img221.imageshack.us/img221/1...widegt1.th.png
http://img97.imageshack.us/img97/3565/tabwidget2.th.png
Voici mon code :
Code:
1
2
3
4
5
6
7
8
9
10 Resources res = getResources(); drawable_left_actif = res.getDrawable(R.drawable.velostar_ios_onglet_gauche_actif2); drawable_left_inactif = res.getDrawable(R.drawable.velostar_ios_onglet_gauche_inactif2); drawable_right_actif = res.getDrawable(R.drawable.velostar_ios_onglet_droite_actif2); drawable_right_inactif = res.getDrawable(R.drawable.velostar_ios_onglet_droite_inactif2); tabHost.getTabWidget().setPressed(false); tabHost.getTabWidget().getChildAt(0).setBackgroundDrawable(drawable_left_actif); tabHost.getTabWidget().getChildAt(1).setBackgroundDrawable(drawable_right_inactif);
Code:
1
2
3
4
5
6
7
8
9
10
11
12 public void onTabChanged(String tabId) { if(tabHost.getCurrentTab() == 0){ tabHost.getTabWidget().getChildAt(0).setBackgroundDrawable(drawable_left_actif); if(tabHost.getTabWidget().getChildAt(1) !=null){ tabHost.getTabWidget().getChildAt(1).setBackgroundDrawable(drawable_right_inactif); } } else{ tabHost.getTabWidget().getChildAt(0).setBackgroundDrawable(drawable_left_inactif); tabHost.getTabWidget().getChildAt(1).setBackgroundDrawable(drawable_right_actif); } }