Delete the pressed effect on the action bar icon.

Firstly, a few words about the application: the minimum level is 16, I use DrawerLayout (with an indicator) and changed the background of my ActionBar.

When I click on the "Home" button to open the box, a blue press appears on the image and indicator of the box, which I would like to delete. I tried setting the selectableItemBackground in the styles to transparency, almost everywhere I could think of, but that doesn't change anything. Anyone have a solution?

Here is an image of this effect that I would like to remove:

example image

Here is the styles.xml part for the ActionBar that I am using:

 <style name="ActionBar.Solid.Bnp" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"> <item name="android:background">@drawable/action_bar_green</item> <item name="android:titleTextStyle">@style/ActionBar.Title</item> <item name="android:actionBarItemBackground">@null</item> </style> 

and finally drawable is used for the background .

+1
source share
1 answer

selectableItemBackground is close, but you need to use the actionBarItemBackground attribute actionBarItemBackground .

For instance:

 <style name="Your.Theme" parent="@android:style/Theme.Holo.Light.DarkActionBar"> <item name="android:actionBarItemBackground">@null</item> </style> 

You should keep in mind that the system also uses this attribute in the ActivityChooserView , which returns the ShareActionProvider in the ActionProvider.onCreateActionView .

To highlight all of this, here are the results you use instead of @android:color/holo_red_light :

Example

+5
source

All Articles