I want to change white color of text to orange.
Here is a example.
You can change the color of the MenuItem
text easily by using SpannableString
instead of String
.
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.your_menu, menu);
int positionOfMenuItem = 0; // or whatever...
MenuItem item = menu.getItem(positionOfMenuItem);
SpannableString s = new SpannableString("My red MenuItem");
s.setSpan(new ForegroundColorSpan(Color.RED), 0, s.length(), 0);
item.setTitle(s);
}
This can be done through setting some styles for your action bar. It is explained in this blog post http://android-developers.blogspot.com.au/2011/04/customizing-action-bar.html
You need to set this in your style for you app.
<style name="MyTheme" parent="android:style/Theme.Holo.Light">
<item name="android:dropDownListViewStyle">@style/MyDropDownListView</item>
</style>
Then you can specify this style with your own text color.
<!-- style the items within the overflow menu -->
<style name="MyDropDownListView" parent="android:style/Widget.Holo.ListView.DropDown">
<!-- This is the orange text color -->
<item name="android:textColor">#CC3232</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With