i am using orange color theme in ma action bar ,In edit Text when user try to do copy,paste it invokes the contextual action with default blue color background ,it's little weird for users,can i change the background of contextual action bar ?
Styling the contextual action bar?
Asked Answered
Try adding this to your style in your styles.xml and use any custom color you would like.
<item name="android:actionModeBackground">@android:color/holo_orange_light</item>
You can also change the drawables for each icon using similar code.
android:actionModeCloseDrawable
android:actionModeCopyDrawable
android:actionModeCutDrawable
android:actionModePasteDrawable
android:actionModeSelectAllDrawable
Credit to the tutorial here - http://www.codercowboy.com/2013/07/05/styling-the-contextual-action-bar-actionmode-divider-or-splitter-for-android/ for changing the contextual action bar icons. Which told me that starting with actionMode changes the contextual action bar attributes
Thanks a lot.where did u get this? is this on documentation? –
Kizzykjersti
I found a tutorial here - codercowboy.com/2013/07/05/… talking about changing the icons so I knew that it would start with acitonMode and I saw Background was an option, tried it and it worked. –
Bruce
@Kizzykjersti no problem! Unfortunately I did not find any official documentation on it –
Bruce
I case this doesn't work for you (and still have the white bar with white icons), I found other style to be set that does work: https://mcmap.net/q/137501/-how-to-customize-the-contextual-action-bar-using-appcompat-in-material-design –
Hooray
© 2022 - 2024 — McMap. All rights reserved.