对Dialog添加动画效果

Dialog mDialog = new AlertDialog.Builder(context).create(); WindowManager.LayoutParams param = mDialog.getWindow().getAttributes(); param.windowAnimations = R.style.dialog_exit; mDialog.show();

在styles里面设置style  dialog.exit

in_translate_top.xml

out_translate_top.xml