Skip to content Skip to sidebar Skip to footer

Android ActionBar Change Item Color On Click

In the action bar I have items that are presented in text, not icons. On click I want to change the color of this text from blue to white. I don't want to change the background wit

Solution 1:

<style name="AppTheme" parent="android:Theme.Holo">
    <item name="android:actionMenuTextColor">@color/action_item_text_color</item>
</style>

R.color.action_item_text_color:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:color="#fff"/>
    <item android:color="#00f"/>
</selector>

Post a Comment for "Android ActionBar Change Item Color On Click"