标签无图标 [英] Tabs without icon

查看:105
本文介绍了标签无图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案
  
    

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

  

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

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

将其更改为:

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

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);

这篇关于标签无图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆