【Android】设置Dialog
作者:互联网
private Dialog alertDialog = new AlertDialog.Builder(context).
setView(view).
create();
alertDialog.getWindow().setDimAmount(0f);//设置透明背景
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());//设置背景填充
alertDialog.getWindow().setGravity(Gravity.LEFT | Gravity.BOTTOM);//设置位置
alertDialog.setCancelable(false);//设置点击返回键dialog不消失
alertDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);//FLAG_LAYOUT_NO_LIMITS设置窗口可以点击下面的界面,FLAG_LAYOUT_NO_LIMITS设置可以移到窗口之外
标签:Dialog,LIMITS,LayoutParams,WindowManager,alertDialog,FLAG,设置,getWindow,Android 来源: https://www.cnblogs.com/beihainanzhu/p/16334248.html