Here\'s what I\'d like to remove :
How do I replace the indicator show
For TabLayout
:
Just Use app:tabIndicatorColor="@android:color/transparent"
<android.support.design.widget.TabLayout
android:id="@+id/profile_album_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:theme="@style/AppTheme.AppBarOverlay"
app:tabBackground="@drawable/tab_background"
app:tabIndicatorColor="@android:color/transparent"
app:tabPadding="@dimen/common_margin" />
here what I use, since the tabIndicator.setSelectedTabIndicatorHeight(0);
is depcrecated
use tabIndicator.setSelectedTabIndicator(0);
I looked for a long time to remove the ugly holo menu bar tried everything. accidentally used this code for another reason and it thank god removed it.
for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#FF0000")); // unselected
TextView tv = (TextView)tabhost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs
tv.setTextColor(Color.parseColor("#ffffff"));
}
Source: Android tabhost change text color style
You can simply use this method on your tablayout to hide the tab indicator.
tabLayout.setSelectedTabIndicatorColor(Color.TRANSPARENT);
Use this app:tabIndicator="@null"
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabIndicator="@null"
app:tabMode="fixed" />
Add this to your TabLayout XML
:
app:tabIndicator="@null"