DialogFragment的宽高设置 发表于 2018-12-29 方法一123456789@Overridepublic void onResume() { ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes(); params.width = LayoutParams.MATCH_PARENT; params.height = LayoutParams.MATCH_PARENT; getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); super.onResume();} 方法二12345@Overridepublic void onResume() { getDialog().getWindow().setLayout(width, height); super.onResume();}