转载自:https://blog.youkuaiyun.com/dingdewei113/article/details/106407996
解决如下:
当PopupWindow设置了setFcousable属性后,会导致导航栏唤出
private static final int FULL_SCREEN_FLAG =
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_FULLSCREEN;
popupWindow.setFocusable(false);
popupWindow.showAtLocation(view, x, y);
popupWindow.getContentView().setSystemUiVisibility(FULL_SCREEN_FLAG);
popupWindow.setFocusable(true);
popupWindow.update();
本文介绍了一种防止PopupWindow导致导航栏意外弹出的方法。通过先设置PopupWindow不可聚焦,显示后再更新为可聚焦状态,并调整系统UI可见性标志实现沉浸式效果。
1万+





