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
448 views
in Technique[技术] by (71.8m points)

android - How do I remove the selected tab indicator from the TabWidget?

Here's what I'd like to remove :

enter image description here

How do I replace the indicator showing which tab is currently shown as well as the blue line that spans the entire tabwidget?

To Specify: All I want indicating which tab is selected is this :

  • tab_button_active.9.png should be shown as background if the tab is SELECTED
  • tab_button_inactive.9.png should be shown as the background if the tab is NOT SELECTED.

edit : Setting tabStripEnabled to false has no effect. Adding a style to it and having "@android:style/Widget.Holo.ActionBar" as its parent is also not possible since im targetting API level 7 and the ActionBar was implemented in API level 11.

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

I have yet another hack.

    TabLayout tabLayout = (TabLayout) fragmentView.findViewById(R.id.tabs);
    tabLayout.setSelectedTabIndicatorHeight(0);

It's basically the same idea as Eleojasmil's.


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

...