开发者

Android Tabs: don't display the text underneath

开发者 https://www.devze.com 2023-04-10 13:03 出处:网络
Maybe I\'m not reading it carefully enough, but the Tab Layout tutor开发者_StackOverflowial doesn\'t specify how to display a tab without the icon or without the text underneath. Are either of these p

Maybe I'm not reading it carefully enough, but the Tab Layout tutor开发者_StackOverflowial doesn't specify how to display a tab without the icon or without the text underneath. Are either of these possible? If so, how do I do it?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消