How to change background color popup menu android

Add popupMenu style to ur AppTheme: <style name=”AppTheme” parent=”android:Theme.Light”> <item name=”android:popupMenuStyle”>@style/PopupMenu</item> </style> <style name=”PopupMenu” parent=”@android:style/Widget.PopupMenu”> <item name=”android:popupBackground”>@android:color/white</item> </style> manifest.xml: <application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/AppTheme” > …………. </application>

Changing text color of menu item in navigation drawer

<android.support.design.widget.NavigationView android:id=”@+id/navigation_view” android:background=”#000″ android:layout_height=”match_parent” android:layout_width=”match_parent” android:layout_gravity=”start” app:headerLayout=”@layout/header” app:itemTextColor=”your color” app:menu=”@menu/drawer” />

Change background color of android menu [duplicate]

When ur are inflating the menu call this setMenuBackground() method @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater=getMenuInflater(); inflater.inflate(R.menu.menu,menu); setMenuBackground(); return true; } and write this in the setMenuBackground() method protected void setMenuBackground(){ // Log.d(TAG, “Enterting setMenuBackGround”); getLayoutInflater().setFactory( new Factory() { public View onCreateView(String name, Context context, AttributeSet attrs) { if ( name.equalsIgnoreCase( “com.android.internal.view.menu.IconMenuItemView” ) … Read more

trying creating dropdown menu pygame, but got stuck

The menu title, the options and the status of the menus should be attributes of the DropDownclass: class DropDown(): def __init__(self, color_menu, color_option, x, y, w, h, font, main, options): self.color_menu = color_menu self.color_option = color_option self.rect = pg.Rect(x, y, w, h) self.font = font self.main = main self.options = options self.draw_menu = False self.menu_active … Read more

Android : Get view Reference to a Menu Item

You can achieve this by providing your menu item with an actionViewClass property in xml and then you will be able to get the pivot view u wanted. The code would be something like this <item android:id=”@+id/menu_find” android:showAsAction=”ifRoom” android:actionViewClass=”android.widget.ImageButton” /> In your OnCreateOptionsMenu do this public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.menu_search, menu); locButton = … Read more

sliding drawer appear in all activities

Extending is the right way. Just override setContentView in the right way. Here’s the working example, but instead of drawer, I use a created a custom tabbar: Define a layout with your drawer like this: this is act_layout.xml <LinearLayout … android:orientation=”vertical” > <YourDrawer … /> <FrameLayout android:id=”@+id/act_content” … > // Here will be all activity … Read more