Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

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.

like image 904
CodePrimate Avatar asked Feb 03 '13 12:02

CodePrimate


People also ask

How do I deselect a tab?

Depress Alt and select the first sheet, release the Alt key and select the first sheet again to make it the active one. Depress Alt and select the second tab, sheet deactivates, the other previously selected sheets remain blocked.


2 Answers

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.

like image 181
Bart Burg Avatar answered Sep 21 '22 19:09

Bart Burg


This line app:tabIndicatorHeight="0dp" solve the problem for me in xml

 <android.support.design.widget.TabLayout         android:id="@+id/view_bottom_tabLayout"         android:layout_width="match_parent"         android:layout_height="wrap_content"         app:tabIndicatorHeight="0dp"             //this line         app:tabGravity="fill"         app:tabMode="fixed" /> 
like image 22
SaravanaRaja Avatar answered Sep 24 '22 19:09

SaravanaRaja