Android Dialog 设置窗体背景颜色以及宽高

dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);设置窗体背景透dialog.getWindow().setGravity(Gravity.BOTTOM);设置出现的位置
设置当前窗体的大小
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
WindowManager.LayoutParams attributes = giftChangeDialog.getWindow().getAttributes();
attributes.width = WindowManager.LayoutParams.MATCH_PARENT;
attributes.height = WindowManager.LayoutParams.MATCH_PARENT;
dialog.getWindow().setAttributes(attributes);

你可能感兴趣的:(随笔)