答案 0 :(得分:0)
您必须显式设置对话框的尺寸,否则它将压缩空格。因此,将其指定如下:-
ViewGroup.LayoutParams params = yourDialog.getWindow().getAttributes();
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
// or a value specified in dimensions like R.dimen.custom_width