PopupWindow showAtLocation运行不佳

时间:2017-10-23 04:37:33

标签: android popupwindow

我使用下面的代码显示PopupWindow,但效果不佳。

View view = getWindow().getDecorView().getRootView();    
popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, 0, 0);

导致自定义手机API 25(它运作良好) enter image description here

 popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, 0, 30);

导致自定义手机API 25(PopupWindow设置y = 0 相同,即使我们设置= 30) enter image description here

 popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, 0, 60);

导致自定义电话API 25(PopupWindow有上边距) enter image description here

 popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, 0, 60);

导致 Google Nexus 5 API 21 (状态栏上方为PopupWindowenter image description here

我想在所有设备中显示PopupWindow以下状态栏20dp。任何帮助或建议都将非常感激。

0 个答案:

没有答案