方案:
getWindow().getDecorView().setBackground(null);//关键
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.gravity = Gravity.BOTTOM;
attributes.width = WindowManager.LayoutParams.MATCH_PARENT;
attributes.height = WindowManager.LayoutParams.WRAP_CONTENT;
getWindow().getDecorView().setPadding(0, 0, 0, 0);
getWindow().setAttributes(attributes);
原因:
DecorView的原因,限制了Dialog无法占满。