Android Dialog自定义宽高

		Builder mBuilder = new Builder(ctx);
		Dialog mAlert = mBuilder.create();
		mAlert.show();

		Window window = mAlert.getWindow();
		WindowManager.LayoutParams P = window.getAttributes();
		P.width = 自定义宽度(px);
		P.height = 自定义高度(px);
		window.setAttributes(P);
		window.setBackgroundDrawableResource(android.R.color.transparent);// 去掉dialog的默认背景
		mAlert.setContentView(contentView);

你可能感兴趣的:(android)