Android Change Action Bar Text Color -
this question has answer here:
- actionbar text color 18 answers
i want change color of action bar instead of white text want #59380d added color color.xml this:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="#59380d"/> </selector>
and call styles.xml this:
<resources> <style name="appbasetheme" parent="android:theme.light"> <item name="android:textcolor">@color/header</item> </style> <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <item name="android:textcolor">@color/header</item> </style> </resources>
and @ androidmanifest set aplication this:
<application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:name="com.app.activities.myap" android:theme="@style/apptheme" > ... </aplication>
but text of action bar still white. i'm doing wrong
for android 3.0 , higher need override:
<style name="customactionbartheme" parent="@style/theme.holo"> <item name="android:actionbarstyle">@style/myactionbar</item> </style> <!-- actionbar styles --> <style name="myactionbar" parent="@style/widget.holo.actionbar"> <item name="android:titletextstyle">@style/myactionbartitletext</item> </style> <!-- actionbar title text --> <style name="myactionbartitletext" parent="@style/textappearance.holo.widget.actionbar.title"> <item name="android:textcolor">@color/actionbar_text</item> </style>
for 2.1 , higher:
<style name="customactionbartheme" parent="@style/theme.appcompat"> <item name="android:actionbarstyle">@style/myactionbar</item> <!-- support library compatibility --> <item name="actionbarstyle">@style/myactionbar</item> </style> <!-- actionbar styles --> <style name="myactionbar" parent="@style/widget.appcompat.actionbar"> <item name="android:titletextstyle">@style/myactionbartitletext</item> <!-- support library compatibility --> <item name="titletextstyle">@style/myactionbartitletext</item> </style> <!-- actionbar title text --> <style name="myactionbartitletext" parent="@style/textappearance.appcompat.widget.actionbar.title"> <item name="android:textcolor">@color/actionbar_text</item> <!-- textcolor property backward compatible support library --> </style>
Comments
Post a Comment