android - change the actionbar text color of an item -
trying change actionbar text color of item in action bar. here item
<item android:id="@+id/options_button" android:title="@string/options" android:showasaction="ifroom|withtext"/> and here styles.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="mycustomtheme" parent="@android:style/theme.holo.light"> <item name="android:actionbarstyle">@style/myactionbartheme</item> <item name="android:background">@color/white</item> <item name="android:textcolor">@color/red</item> </style> <style name="myactionbartheme" parent="@android:style/widget.holo.light.actionbar"> <item name="android:background">@color/white</item> <item name="android:textcolor">@color/red</item> </style> </resources> i saw other posts on here after trying solutions nothing worked me? how made theme? wanted action bar white, not display title, , display button says options. have of that, options want red color im working rather black.
dont think people understand...
i know of way change title (i dont have title , dont want one).i want change color of item displaying in actionbar...
i have faced same issue, found solution doing type of actionbar (native, sherlock or compat)
actually can use html code set title, , specify text color. example, set actionbar text color red, this:
getactionbar()/* or getsupportactionbar() */.settitle(html.fromhtml("<font color=\"red\">" + getstring(r.string.app_name) + "</font>")); you can use hex code of red color #ff0000 instead of word red.
but, setting html string on action bar doesn't work on material theme in sdk v21+.
if want change should set primary text color in style.xml below.
<resources> <!-- base application theme. --> <style name="apptheme" parent="android:theme.material.light"> <!-- customize theme here. --> <item name="android:textcolorprimary">@color/actionbar-text-color</item> may helps you.
Comments
Post a Comment