Change title color in toolbar?

how to change action bar title color in android
change toolbar color android
how to change toolbar text color in android
android toolbar background color
android toolbar menu icon color
change toolbar text color android programmatically
android toolbar icon color
change app bar text color android

I have a toolbar that I use, and set title with:

((ActionBarActivity)getActivity()).getSupportActionBar().setTitle("Home");

Is there a way to change the color from black to white?

I tried making its own theme and setting it in the xml like this, but no dice:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme2" parent="Theme.AppCompat">
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/primary</item>
        <item name="colorPrimaryDark">@color/primary_dark</item>
        <item name="colorAccent">@color/accent</item>
        <item name="android:textColorPrimary">@color/primary_text</item>
        <item name="android:textColorSecondary">@color/secondary_text</item>

    </style>

    <style name="Widget.MyApp.ActionBar" parent="Widget.AppCompat.ActionBar">
        <item name="android:background">@color/primary</item>
        <item name="theme">@style/ThemeOverlay.MyApp.ActionBar</item>
        <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
    </style>

    <style name="ThemeOverlay.MyApp.ActionBar" parent="ThemeOverlay.AppCompat.ActionBar">
        <item name="android:textColorPrimary">#FFFFFF</item>
    </style>



</resources>

XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#e5e5e5"
    android:orientation="vertical" >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:minHeight="?attr/actionBarSize"
        android:background="@color/primary"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/Widget.MyApp.ActionBar">

        <Spinner
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/statsSpin"
            android:spinnerMode="dropdown"
            android:textColor="#FFFFFF"/>


    </android.support.v7.widget.Toolbar>



    <ListView
        android:id="@+id/yourStats"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:dividerHeight="0px"
        android:divider="@null"

        >
    </ListView>



</LinearLayout>

Programatically:

toolbar.setTitleTextColor(0xFFFFFFFF);

Change title color in toolbar?, How do you change the color of the title bar on Android? Note : We are calling the Toolbar title text color from Colors.xml file. 1. Open your Project’s build.gradle ( Module : app ) and add com.android.support:appcompat-v7:23.4.0 library file. 2. Here is the code to add appcompat library inside build.gradle file.

Per the Theme vs Style blog post by the creator of AppCompat and the post on version 21 of AppCompat, a DarkActionBar toolbar (i.e., a Toolbar with a dark background and light text), can be accomplished by adding android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" to your Toolbar's XML:

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:minHeight="?attr/actionBarSize"
    android:background="@color/primary"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/statsSpin"
        android:spinnerMode="dropdown"/>


</android.support.v7.widget.Toolbar>

This will change text color and the default colors to many attributes (such as your Spinner to light text as is needed for the dark background.

Xamarin forms Android toolbar text-color, android, android studio, action bar, color, toolbar, background, how to, material design, change Duration: 3:11 Posted: May 7, 2018 Remeber @color/colorText is simply your color.xml file with the color attribute named colorText and your color.This is the best way to calll your strings rather than hardcoding your color inside your toolbar.xml.

Create a new style in application base theme

  <style name="custom_toolbar" parent="@style/Widget.AppCompat.Toolbar">
        <item name="titleTextColor">#replace with color</item>
  </style>

and use the style for the toolbar

  <item name="toolbarStyle">@style/custom_toolbar</item>

How to Change Action Bar Background Color and Title color , Hi,Is there a way to set custom text color to the toolbar title only? this color being applied for both toolbar title and article title. 0. 4 You can style the toolbar on its own by changing the titleTextColor in the ToolbarStyle. To change the title bar text color in Windows 10, do the following. Open Settings. Go to Personalization - Colors. On the right, untick the option "Title bars" under "Show accent color on the following surfaces".

I know there are a lot of answers above hope, it will help someone who doesn't understand above answers.

Android has view called Toolbar.This view has title which always takes as default color from color.xml resources which item name is accent.You can change your toolbar color in two way.

  1. Via xml which I recommend you to do that, here below you can see example

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:titleTextColor="@color/White" />Here you can change it.Remember APP attribute not ANDROID
    
  2. Via programmatically within activity or fragment.

    Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    toolbar.setTitleTextColor(ContextCompat.getColor(this, R.color.colorAccent));
    

Android SDK: customize toolbar text color – Zendesk Develop, Android's new Toolbar, which replaces ActionBar (with some awkward code), makes it easier to change the title text color and the color of the  Changing taskbar color From the right side click the “ Colors ” tab and untick the following “ Auto pick an accent color.” Accent color means the selected color will be used throughout your desktop elements such as in taskbar, start menu and title bars. (You can directly tap on a color to change the taskbar color instantly).

If you want to change only title text color than, Try this one..

getSupportActionBar().setTitle(Html.fromHtml("<font color='#746E66'>"+titleText+"</font>"));

it works..!!

Android: Changing the Toolbar's text color and overflow icon color , Title"> <item name="android:textColor">@color/text_color</item> </style> The first solution I found is to change the action bar text color  The light theme expects your App Bar 1 (Toolbar or ActionBar) to have a light background color, so it gives you a dark title and dark overflow menu icon (the three vertical dots): The dark theme expects your App Bar to have a dark background color, so it gives you a white title and white overflow menu icon:

ActionBar title text color, Changing the Android Toolbar's Back Arrow Color. I'm using the new v7 Change action bar title text color in android programmatically.Set action bar text color  Windows 10’s first big update  added an official way to do this. Now, you can simply open the Settings app, navigate to Personalization > Colors, and activate the “Show color on Start, taskbar, action center, and title bar” option. By default, it will automatically select a color based on your desktop background.

set toolbar title color android, Top solutions include defining a custom Toolbar layout, setting text… A quick search on our beloved-yet-fickle Stack Overflow yields a handful of strategies for changing the font of the Toolbar. android:background="@color/colorPrimary" Change the color of the Start menu, taskbar, and action center. Applies to: Windows 10. Select Start > Settings . Select Personalization and then choose Colors. Under Show accent color on the following surfaces, select the Start, taskbar, and action center and Title bars check boxes.

How to change the Toolbar font on Android - Livefront, I'm using the new v7 Toolbar and for the life of me can't figure out how to change the color of the title. I've set the @style of the Toolbar to a style declared in  1.Go to Settings and select Personalization. 2.Select Color. 3.Turn "Automatically pick an accent color from my background" Off and select the color which you wish to have. 4.Turn Off "Show color on Start, taskbar, action center, and title bar".

Comments
  • You mean programatically or via a theme?
  • it is repeated question answered at stackoverflow.com/a/2285722/2149195
  • @RaviKoradiya That answer is outdated, FWIW, for an old version of Android.
  • It's not an answer but an info. You don't need to write ((ActionBarActivity)getActivity()).getSupportActionBar().setTitle("Home"); to change the Toolbar Title. Just write setTitle(getString(R.string.title)); that's it
  • it will support above api 23
  • Not if you're using the AppCompat library.
  • worked for me with: toolbar.setTitleTextColor(android.graphics.Color.WHITE); .. thanks!
  • can we get a modern answer with darktheme awareness?
  • Why app:theme and not android:theme (both work)?
  • Prior to AppCompat 22.1, you had to use app:theme - if you are using a version later than that (which you should at this point), then yes, you should be using android:theme everywhere. I've updated my answer to reflect today's best practices.
  • Note that "toolbarStyle" attribute only api 21+