AlertDialog控件设置宽高大小(草稿)

简单方法: 

alertDialog.getWindow().setLayout(600, 400); //Controlling width and height.

常规方法 

WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(alertDialog.getWindow().getAttributes());
lp.width = 150;
lp.height = 500;
lp.x=-170;
lp.y=100;
alertDialog.getWindow().setAttributes(lp);

猜你喜欢

转载自blog.csdn.net/yh18668197127/article/details/84965883
今日推荐