Android ListPopupWindows错误的水平定位

Android ListPopupWindows错误的水平定位,android,popup,Android,Popup,如上所述,我使用ListPopupWindow显示一个显示3个项目的弹出列表,并使用以下代码对其进行初始化: mPopupAdapter = new PopupWindowAdapter(LauncherActivity.this, microapps); mPopupWindow = new ListPopupWindow(LauncherActivity.this); mPopupWindow.setAdapter(mPopupAdapter); mPopup

如上所述,我使用ListPopupWindow显示一个显示3个项目的弹出列表,并使用以下代码对其进行初始化:

    mPopupAdapter = new PopupWindowAdapter(LauncherActivity.this, microapps);
    mPopupWindow = new ListPopupWindow(LauncherActivity.this);
    mPopupWindow.setAdapter(mPopupAdapter);
    mPopupWindow.setAnchorView(mMicroAppBtn);
    mPopupWindow.setWidth(ListPopupWindow.MATCH_PARENT);
    mPopupWindow.setVerticalOffset(-60);
    mPopupWindow.setModal(true);
mMicroAppBtn是下面选项卡栏中的大红色按钮

在大多数设备上,ListPopupWindow看起来很好(与上面的不同),换句话说,它是从屏幕的左侧开始的,而不是从上面的中心开始的,这就是我想要的


但在某些设备上,它显示为如上图所示,我尝试了几种方法,但没有一种对我有效。

检查此项我使用ListPopupWindow否PopupWindow链接中的解决方案不适用,我的意思是没有
showAtLocation()
方法ListPopupWindow@MohammadHaidar嗨,你能解决这个问题吗issue@MRamzan我真的不记得了,但是你能试着添加mpoppupWindow.setPromptPosition(上面的ListPopupWindow.POSITION\u PROMPT\u);以及移除窗口。设置垂直偏移(-60);我真的很感谢你的回答。我不知道这是否是一个错误,但设置垂直偏移低于-450开始工作。经过一点调整,在-350时,我得到了它想要的位置。