android - How to change color of menu in actionbar? -


i want change background of menu , set blue. background of menu black.how change this? menu xml file :

<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.nabege.aboutusactivity" >   <item     android:id="@+id/help"      android:title="@string/help" /> <item     android:id="@+id/setting"     android:title="@string/setting"/> 

java codes :

  @override         public boolean oncreateoptionsmenu(menu menu) {             getmenuinflater().inflate(r.menu.about_us, menu);             return super.oncreateoptionsmenu(menu);         } 

enter image description here

put following styles in styles.xml

<style name="apptheme" parent="theme.appcompat.light">         <item name="colorprimary">@color/primary_color</item>         <!--<item name="colorprimarydark">@color/primary_color</item>-->         <item name="coloraccent">@color/primary_color</item>         <item name="actionbarstyle">@style/appthemeactionbarstyle</item> </style>  <style name="appthemeactionbarstyle" parent="@style/widget.appcompat.light.actionbar">         <item name="background">@color/your_background_color</item> </style> 

hope helps.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -