Ladan Nekuii
Ladan Nekuii

Reputation: 325

Change the color of Contextual Action Bar

I'm trying to figure out how to change the color of the contextual action bar menu (CAB) for example i want to have red CAB in my app,and i use the CAB in one of my fragments, Any help would be appreciated! Thanks!

Upvotes: 2

Views: 1257

Answers (2)

Ramees
Ramees

Reputation: 76

create a new style like below and use that style in your activity theme

<style name="styleActionMode" parent="@style/Widget.AppCompat.ActionMode">
<item name="background">your color code</item>
<item name="actionMenuTextColor">your color code</item>

Upvotes: 1

Mehul Joisar
Mehul Joisar

Reputation: 15358

You need to add following in your theme defined under styles.xml,​

<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="android:actionModeBackground">@drawable/actionmode_background</item>`

Upvotes: 2

Related Questions