如何强制PopupMenu重叠锚?我想重新创建类似于
this的东西:
解决方法
设置overlapAnchor允许我重叠锚视图而不设置偏移量:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="popupMenuStyle">@style/PopupMenu</item> </style> <style name="PopupMenu" parent="@style/Widget.AppCompat.Light.PopupMenu"> <item name="overlapAnchor">true</item> </style>
PopupMenu包含一个ListPopupWindow.该ListPopupWindow使用这个overlapAnchor属性包装AppCompatPopupWindow.所有这些在支持库中.