Android action bar's title color not changing -
i change contextual action bar's title text color , button colour.
please find code using, still couldn't able achieve
<!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="android:actionmodebackground">@color/dark_blue_shade1</item> <item name="android:windowactionmodeoverlay">true</item> <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/white</item> </style>
please me fix
</style> <style name="mytheme" parent="@android:style/theme.holo.light"> <item name="android:actionbarstyle">@style/mytheme.actionbarstyle</item> </style> <style name="mytheme.actionbarstyle" parent="@android:style/widget.holo.light.actionbar"> <item name="android:titletextstyle">@style/mytheme.actionbar.titletextstyle</item> <item name="android:subtitletextstyle">@style/mytheme.actionbar.titletextstyle</item> <item name="android:background">#0061c2</item> <item name="android:icon">@android:color/transparent</item><!--hiding icon ..in case want it..--> </style> <style name="mytheme.actionbar.titletextstyle" parent="@android:style/textappearance.holo.widget.actionbar.title"> <item name="android:textcolor">#ffffff</item> </style>
and in manifest ...you can apply theme app
<application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/mytheme" ><!--this theme-->
or 1 of activities
<activity android:name="eddine.charef.mechalikh.swipedemo.mainactivity" android:label="@string/mainactivity" android:theme="@style/mytheme" >
that's all
edit: found in android developpers website
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- theme applied application or activity --> <style name="customactionbartheme" parent="@style/theme.appcompat"> <item name="android:actionbarstyle">@style/myactionbar</item> <item name="android:actionbartabtextstyle">@style/myactionbartabtext</item> <item name="android:actionmenutextcolor">@color/actionbar_text</item> <!-- support library compatibility --> <item name="actionbarstyle">@style/myactionbar</item> <item name="actionbartabtextstyle">@style/myactionbartabtext</item> <item name="actionmenutextcolor">@color/actionbar_text</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> <!-- actionbar tabs text --> <style name="myactionbartabtext" parent="@style/widget.appcompat.actionbar.tabtext"> <item name="android:textcolor">@color/actionbar_text</item> <!-- textcolor property backward compatible support library --> </style> </resources>
here link https://developer.android.com/training/basics/actionbar/styling.html
Comments
Post a Comment