Android app label color

41,985

Solution 1

styles.xml

<style name="MyTheme" parent="@android:style/Theme.Holo">
         <item name="android:actionBarStyle">@style/MyActionBar</item>

</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
         <item name="android:background">#FF9D21</item>
         <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style> 
<style name="MyActionBarTitleText"
           parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/red</item>
</style>

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="red">#FF0000</color>
</resources>

For more info

https://developer.android.com/training/basics/actionbar/styling.html#CustomText

Snap

enter image description here

Edit : For making it bold

 <style name="MyActionBarTitleText"
           parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/red</item>
        <item name="android:textStyle">bold</item>
 </style>

Solution 2

None of the previous answers worked for me, so I'm showing the one that worked in my case.

<style name="AppThemeCustom" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@android:color/black</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="actionBarStyle">@style/MyActionBar</item>
    <item name="android:windowBackground">@android:color/white</item>
</style>

<style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">
    <item name="android:titleTextStyle">@style/MyTitleTextStyle</item>
    <!-- Support library compatibility -->
    <item name="titleTextStyle">@style/MyTitleTextStyle</item>
</style>

<style name="MyTitleTextStyle" 
  parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
    <item name="android:textColor">@android:color/black</item>
</style>

I wish if you find yourself in my situation this solution save your day. LOL

Share:
41,985
user3082220
Author by

user3082220

Updated on May 28, 2020

Comments

  • user3082220
    user3082220 almost 4 years

    I don't want to create any custom layout for app label, just want to change it's color to white (now it's black). How could I do that?

    <?xml version="1.0" encoding="utf-8"?>
    <resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
    
    </style>
    
    <style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">@drawable/bg_blue_solid_onclick</item> 
    //////CHANGE label color    
    </style>
    </resources>