Android開發中如何設置對話框實現全屏

Android開發中如何設置對話框實現全屏。

   // 全屏
            WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();
            lp.width = WindowManager.LayoutParams.MATCH_PARENT;
            lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
            dialog.getWindow().setAttributes(lp);

You May Also Like