个人笔记,留下以后用。

android 自定义alertdialog宽充满屏幕

		alertDialog = new AlertDialog.Builder(this).setCancelable(false)
				.create();
		alertDialog.setView(getLayoutInflater().inflate(
				R.layout.diy_exit_alertdialog, null));
		alertDialog.show();
		alertDialog.setCanceledOnTouchOutside(false);
		dialogWindow = alertDialog.getWindow();
		alertDialog.getWindow().getAttributes().width=
                (int)dialogWindow.getWindowManager().getDefaultDisplay().getWidth();
		dialogWindow.setGravity(Gravity.BOTTOM);

标签: 自定义alertdialog, android

添加新评论