how to change color of padding of popup menu in android?

28 Views Asked by At

I'm new to android. I want to create a popup menu with custom color but I don't know how to set color of padding in popup menu. enter image description here

this is my style:

<style name="temp" parent="Widget.AppCompat.PopupMenu">
    <item name="android:panelFullBackground">@color/teal_200</item>
    <item name="android:popupBackground">@color/teal_200</item>
    <item name="android:colorBackground">@color/teal_200</item>
    <item name="android:itemBackground">@color/teal_200</item>
</style>

and this is how I set in java:

Context menuStyleContext = new ContextThemeWrapper(activity, R.style.temp);
PopupMenu popupMenu = new PopupMenu(menuStyleContext, holder.menuButton);

what should I do?

0

There are 0 best solutions below