Android Dialog全屏方法

Window window =this.getWindow();

if (window !=null) {

window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);

    window.getDecorView().setPadding(0, 0, 0, 0);

    window.setBackgroundDrawableResource(android.R.color.transparent);

    WindowManager.LayoutParams lp =this.getWindow().getAttributes();

    lp.width = WindowManager.LayoutParams.MATCH_PARENT;

    lp.height = WindowManager.LayoutParams.MATCH_PARENT;

    window.setAttributes(lp);

}

你可能感兴趣的:(Android Dialog全屏方法)