How to change the font color of the application title

Asked

Viewed 4,993 times

4

I’m looking to change the font color of the application title

inserir a descrição da imagem aqui

There where it is written COMO ESTOU DIRIGINDO? how to do this?

1 answer

4


Android 2.1 and higher
If you are using Support Library change the file values/Styles.xml to look like this:

<resources>

    <!-- Base application theme. -->
    <!-- Esta primeira linha deixe ficar igual à sua -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

        <!-- Inclua estas duas linhas -->
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="actionBarStyle">@style/MyActionBar</item>

    </style>

    <!-- Inclua este style -->
    <style name="MyActionBar"
        parent="@style/Widget.AppCompat.ActionBar">
        <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
        <item name="titleTextStyle">@style/MyActionBarTitleText</item>
    </style>

    <!-- Inclua este style, altere o código para a cor que pretender -->
    <style name="MyActionBarTitleText"
        parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">

        <!-- Cor vermelha -->
        <item name="android:textColor">#FFFF0000</item>
    </style>

</resources>  

For Android 3.0 and higher(without Support Library)
Change the file values/Styles.xml to look like this:

<resources>
    <!-- the theme applied to the application or activity -->
    <!-- Esta primeira linha deixe ficar igual à sua -->
    <style name="CustomActionBarTheme"
           parent="@style/Theme.Holo">

        <!-- Inclua esta linha -->
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>

    <!-- Inclua este style -->
    <style name="MyActionBar"
           parent="@style/Widget.Holo.ActionBar">
        <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
    </style>

    <!-- Inclua este style, altere o código para a cor que pretender -->
    <style name="MyActionBarTitleText"
           parent="@style/TextAppearance.Holo.Widget.ActionBar.Title">

        <!-- Cor vermelha -->
        <item name="android:textColor">#FFFF0000</item>
    </style>

</resources>

Source: Documentation of Android

  • and to change title source?

  • @Rodolfo Use <item name="android:fontFamily">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.