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

When clicking on the home button to open the drawer, there is a blue pressed effect on both the image and the drawer indicator, that I'd like to remove. I tried setting selectableItemBackground in the styles to transparent, nearly everywhere I could think of, but that doesn't seem to change anything. Do anyone have a solution ?

Here is the image of this effect I'd like to remove :

example image

Here is the styles.xml part for the ActionBar I'm 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 the drawable used for background.

有帮助吗?

解决方案

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

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 uses this attribute in the ActivityChooserView too, which is what the ShareActionProvider returns in ActionProvider.onCreateActionView.

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

Example

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top