I have an ActionBar
, the color of which matches the color of the pressed home
button, and clicking imperceptibly!
How to change the color of the Actionbar button?
Write an xml file with the selector tag:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_pressed" android:state_pressed="true" /> <item android:drawable="@drawable/button" /> </selector>
moreover, in android:drawable=""
you can shove both a picture and a color.
and the selector file must be in the \project_name\res\drawable
.
then refer to this selector either in code or in the layout description.
You can also override the android:actionBarItemBackground
in the used theme.
Source: https://ru.stackoverflow.com/questions/296237/
All Articles
<item name="android:actionBarItemBackground">@drawable/btn</item>
<item name="actionBarItemBackground">@drawable/btn</item>
- tim_tallerActionBar
- tim_taller