标签:gets 单选框 set out 弹窗 his dial height dia
private AlertDialog alertDialog2; //单选框
//在show方法后使用
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels; // 屏幕宽度(像素)
int height = dm.heightPixels; // 屏幕高度(像素)
WindowManager.LayoutParams params = alertDialog2.getWindow().getAttributes();
params.width = (int) (0.65*width);
params.height = (int) (0.6*height);
alertDialog2.getWindow().setAttributes(params);
标签:gets 单选框 set out 弹窗 his dial height dia
原文地址:https://www.cnblogs.com/sunjian43792901/p/11218239.html