AlertDialog dialog = builder.setTitle("消息列表") .setView(layout) .create(); dialog.show(); //设置窗口的大小 dialog.getWindow().setLayout(300, 200);
WindowManager.LayoutParams.MATCH_PARENT