Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app label color

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>
like image 405
user3082220 Avatar asked Dec 15 '13 17:12

user3082220


1 Answers

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>
like image 192
Raghunandan Avatar answered Sep 22 '22 23:09

Raghunandan