Skip to content Skip to sidebar Skip to footer

How To Change The Action Bar Tab Text Color

I need to change the Action bar tab text color.So far Action bar tab text color displayed in black.But I need to change it into white color. Manifest:

Solution 1:

Declare this in your AppTheme:

<item name="android:actionBarTabTextStyle">@style/tabtextcolor</item>

Then here is the style declaration:

<stylename="tabtextcolor"parent="@android:style/Widget.Holo.Light.ActionBar.TabText"><itemname="android:textColor">@android:color/white</item></style>

Solution 2:

Use this in our theme to set the actionbar text color:

<itemname="titleTextStyle">@style/ActionBar.CustomTitle</item><!-- ActionBar title text --><stylename="ActionBar.CustomTitle"parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"><itemname="android:textColor">@color/title_detail_color</item><!-- The textColor property is backward compatible with the Support Library --></style>

Sorry, this is for the case you are using AppCompat support library.

You could use the general:

<!-- ActionBar title text --><stylename="ActionBar.CustomTitle"parent="@style/TextAppearance.Holo.Widget.ActionBar.Title"><itemname="android:textColor">@color/title_detail_color</item></style>

Also, instead of Holo, you could try some other themes that match your current theme. You can also read more on the official documentation: https://developer.android.com/training/basics/actionbar/styling.html

Post a Comment for "How To Change The Action Bar Tab Text Color"