Android probleme avec TabHost
Bonsoir tout le monde,
J'utilise un TabHost et je veux affiché une icon & un texte, mais le probleme est
que je n'arrive pas a affiché les deux en meme temps, quand je met le texte l'icon ne s'affiche pas.
Voici ma fonction
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| private void initTabHost() {
//tabHost = new TabHost(getApplicationContext());
tabHost = (TabHost)findViewById(android.R.id.tabhost);
tabHost.setup();
Drawable d = ContextCompat.getDrawable(this, R.drawable.home);
String[] tabName = {"Tab1", "Tab2", "Tab3", "Tab4", "Tab5", "Tab6"};
for(int i =0; i<tabName.length; i++)
{
TabHost.TabSpec tabSpec;
tabSpec = tabHost.newTabSpec(tabName[i]);
tabSpec.setIndicator("", d);
tabSpec.setContent(new FakeContent(getApplicationContext()));
tabHost.addTab(tabSpec);
}
tabHost.setOnTabChangedListener(this);
} |
S'il vous plait si quelqu'un a une idee.
Merci d'avance