美文网首页
dialog全屏且显示透明状态栏

dialog全屏且显示透明状态栏

作者: 霁逸lei | 来源:发表于2023-11-15 16:58 被阅读0次
        Window dialogWindow = aDialog.getWindow();
        //全屏且显示透明状态栏
        dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        dialogWindow.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        dialogWindow.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            dialogWindow.setStatusBarColor(Color.TRANSPARENT);
        }

    相关文章

      网友评论

          本文标题:dialog全屏且显示透明状态栏

          本文链接:https://www.haomeiwen.com/subject/kxnswdtx.html