简体   繁体   中英

Styling the contextual action bar?

我在操作栏中使用橙色主题,在用户尝试复制时编辑文本,粘贴它调用默认蓝色背景的上下文操作,这对用户来说有点奇怪,我可以更改上下文操作栏的背景吗?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM