Skip to content Skip to sidebar Skip to footer

Android Tabs: Don't Display The Text Underneath

Maybe I'm not reading it carefully enough, but the Tab Layout tutorial doesn't specify how to display a tab without the icon or without the text underneath. Are either of these pos

Solution 1:

Have you tried this?

For tab without icon

spec = tabHost.newTabSpec("artists").setIndicator("Artists",null)
                  .setContent(intent);

For tab without text

spec = tabHost.newTabSpec("artists").setIndicator("",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);

Of course, these are just lee way of doing them. For more complicated view on tabs, you may want to have a customized view and use setIndicator (View view) method to get your desired look.


Post a Comment for "Android Tabs: Don't Display The Text Underneath"