Remove blue screen

I am creating an action bar with custom buttons that I put in the menu.xml icon section.

The problem is that when I click on them, I see both the selected version of the button image and the blue background of the bare theme.

This is my .xml menu:

<menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/current_position" android:icon="@drawable/ab_location_layer" android:menuCategory="container" android:showAsAction="ifRoom" android:title="Current position"> </item> </menu> 

This element is ab_location_layer:

 <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/ab_location_pressed" android:state_pressed="true"/> <item android:drawable="@drawable/ab_location" android:state_pressed="false"/> </selector> 

The ab_location_layer file contains an image smaller than the actionBar. How can I remove the blue background in the action bar? I also use actionbarsherlock.

thanks

+6
source share
1 answer

I found the answer on the ActionBarSherlock mailing list:

you need to put this

  <item name="android:selectableItemBackground">@null</item> <item name="android:actionBarItemBackground">@null</item> <item name="actionBarItemBackground">@null</item> 

to your topic, not to the ActionBar theme

+13
source

Source: https://habr.com/ru/post/911927/


All Articles