android AlertDialog自定义大小

AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setView(LayoutInflater.from(context).inflate(R.layout.select_birthday_item,null));
		builder.setTitle("选择出生日期");
		AlertDialog alertDialog = builder.create();
		alertDialog.show();
		WindowManager.LayoutParams  lp= alertDialog.getWindow().getAttributes();
		lp.width=350;//定义宽度
	    lp.height=300;//定义高度
	    alertDialog.getWindow().setAttributes(lp);

你可能感兴趣的:(android琐事)