Skip to content Skip to sidebar Skip to footer

How To Change The Text Color In Android Action Bar

Hello I need help on changing the text color of the action Bar the following is my style.xml.I need to change the text color to white including the settings icon.

Solution 1:

try this

<?xml version="1.0" encoding="utf-8"?><resources><stylename="MyTheme"parent="@android:style/Theme.Holo.Light"><itemname="android:actionBarStyle">@style/MyTheme.ActionBarStyle</item></style><stylename="MyTheme.ActionBarStyle"parent="@android:style/Widget.Holo.Light.ActionBar"><itemname="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item></style><stylename="MyTheme.ActionBar.TitleTextStyle"parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"><itemname="android:textColor">@color/red</item></style></resources>

Solution 2:

Change in your style.

<!-- Base application theme. --><stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar"><!-- Customize your theme here. --><itemname="colorPrimary">@color/colorPrimary</item><itemname="colorPrimaryDark">@color/colorPrimaryDark</item><itemname="colorAccent">@color/colorAccent</item>

Add underneath line:

<itemname="actionMenuTextColor">Your Color Here</item><itemname="textColorPrimary">Your Color Here</item></style>

Hope it helps.

Solution 3:

You can simply put color to your strings like this:

<stringname="app_name"><![CDATA[<b><font color=#FFFFFF>yebo</b>]]></string>

Solution 4:

In your .axml put a RelativeLayout to add the actionbar. In here add a TextView with the property android:textColor="#FFFFFF". (#FFFFFF is white). As such:

<RelativeLayoutandroid:id="@+id/titleBarLinearLayoutFrontPage"android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="55dp"android:background="#696969"><TextViewandroid:textColor="#FFFFFF"android:id="@+id/txtActionBarText"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="My Action Bar"android:layout_gravity="center"android:clickable="true"android:layout_centerVertical="true"android:textSize="22dp"android:layout_alignParentLeft="true"android:layout_marginLeft="60dp"android:layout_centerHorizontal="true" /></RelativeLayout>

Solution 5:

Valus/styles.xml uses colors.xml file. When you press "control" and click @color/colorPrimary it shows you where colorPrimary comes. Which is colors.xml. In your colors.xml file you can edit it.

Colors.xml

When you click the colour on the left it opens color palette. And you can change it easily. Color palette

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