Answer the question
In order to leave comments, you need to log in
How to set popupMenu style programmatically?
Good day to all!
There is a constructor
PopupMenu(Context context, View anchor, int gravity, int popupStyleAttr, int popupStyleRes)
//Constructor a create a new popup menu with a specific style.
<style name="PopupMenuStyle"
parent="@style/Widget.AppCompat.Light.PopupMenu">
<item name="android:textColorPrimary">@color/white</item>
<item name="android:dropDownVerticalOffset">-54dp</item>
<item name="android:textColor">@color/white</item>
<item name="android:popupBackground">@drawable/shadow_popuo_menu</item>
</style>
PopupMenu popup = new PopupMenu(this, textView, Gravity.NO_GRAVITY, 0, R.style.PopupMenuStyle);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question