Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

android - Tabs without icon

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...