标签无图标图标、标签

2023-09-04 11:01:31 作者:驾!驾!驾!

我有一个看看标签布局教程这是完全清楚我的问题很简单:是否有可能不带图标创建标签,只是一个单一的标题

解决方案        

是有可能没有图标创建标签,只是一个单一的标题?

  

是的。如果你正在做的事情,如:

 规格= tabHost.newTabSpec(TAB_NAME)。setIndicator(一些选项卡,
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(意向);
 

将其更改为:

 规格= tabHost.newTabSpec(TAB_NAME)setIndicator(一些选项卡)setContent(意向)。
 

完美LOGO认证图标图片

I'm having a look at the "Tab Layout" tutorial which is perfectly clear and my question is very simple : is it possible to create tabs with no icon, just a single title?

解决方案

is it possible to create tabs with no icon, just a single title?

Yes. If you are doing something like:

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

Change it to:

spec = tabHost.newTabSpec("tab_name").setIndicator("Some tab").setContent(intent);

 
精彩推荐