Android Dialog setting the width and height

Window window = getWindow();
WindowManager.LayoutParams params = window.getAttributes();
params .width = UiUtil.getDimens(R.dimen.qb_px_416);
params .height = UiUtil.getDimens(R.dimen.qb_px_416);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);

Note: You must set will be effective after the show ()!

Published 49 original articles · won praise 2 · Views 8611

Guess you like

Origin blog.csdn.net/yangjunjin/article/details/100590238