没有锚点视图的 PopupMenu?

PopupMenu without anchor view?

我有一个 RecyclerView,其中长按 ItemView 显示 Popupmenu。我的问题是,如果项目长于父级高度(如果没有滚动,屏幕上将看不到顶端和底端)。然后我单击应用程序的中心导致 Unable to create a layer for PopupWindow$PopupBackgroundView' 异常并且应用程序强制关闭。我认为问题是 Popupmenu 没有得到它的锚 space。有谁知道 Popupmenu 没有 Anchor View 吗?

弹出菜单

A popup menu displays a list of items in a vertical list that's anchored to the view that invoked the menu. It's good for providing an overflow of actions that relate to specific content or to provide options for a second part of a command. Actions in a popup menu should not directly affect the corresponding content—that's what contextual actions are for. Rather, the popup menu is for extended actions that relate to regions of content in your activity.
Especially you can't