I am creating an actionbar with custom looking buttons that I put in the icon section of menu.xml.
The problem is that, when I press them, I see both the selected version of the image of the button and the blue background of the holo theme.
This is my menu.xml:
<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>
The ab_location_layer is this:
<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 contains an image that is smaller than the actionBar. How is possible to remove the blue background on actionbar? I am also using actionbarsherlock.
Thanks
The majority of the Android devices feature a built-in blue light setting, one which you can enable by going to Settings and tap on Display. There you will find a setting named either Night Light or Blue Light, through which you can adjust the colouring temperature and schedule when you want to turn it on and off.
To change background color of Action Bar in Kotlin Android, set the colorPrimary in themes. xml, with a required color. We can also dynamically change the background color of Action Bar programmatically by setting background drawable for support action bar with the required color drawable.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
I found the answer on ActionBarSherlock Mailing List:
you have to put this
<item name="android:selectableItemBackground">@null</item>
<item name="android:actionBarItemBackground">@null</item>
<item name="actionBarItemBackground">@null</item>
to your theme and not in ActionBar theme
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