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); }
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
Post a Comment