dialog的应用
第一步:重写dialog: ①代码: public static Dialog creatRequestDialog(final Context context, String tip) { final Dialog dialog = new Dialog(context, R.style.dialog); // dialog.setCancelable(false); // dialog.setCanceledOnTouchOutside(false); dialog.setContentView(R.layout.dialog_layout); Window window = dialog.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); int width = Utils.getScreenWidth(context); lp.width = (int) (0.5 * width); TextView titleTxtv = (TextView) dialog.findViewById(R.id.tvLoad); titleTxtv.setText(tip); return dialog; } ②dialog的style设置: <style name="dialog" parent="