海拔在PopupMenu中不起作用。我尝试使用styles.xml实现PopupMenu的海拔,但无法正常工作。我想为PopupMenu Screenshot for an issue
实现阴影在代码中实现的弹出菜单
Context wrapper = new ContextThemeWrapper(this, R.style.MyPopupMenu);
PopupMenu popup = new PopupMenu(wrapper, vItem);
MenuInflater inflater = popup.getMenuInflater();
popup.setOnMenuItemClickListener(TaskDetailActivity.this);
inflater.inflate(R.menu.overflow_menu, popup.getMenu());
popup.show();
Styles.xml
<style name="MyPopupMenu" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:itemBackground">@color/md_white_1000</item>
<item name="android:clipToPadding">false</item>
<item name="android:popupElevation"
tools:targetApi="lollipop">@dimen/_20sdp</item> </style>