自定义dialog显示在底部

其他
 
  
View dialogView = View.inflate(context, R.layout.dialog_appoint_enlist_fail, null);
final Dialog dialog = new Dialog(context,R.style.noTitleDialog);
WindowManager.LayoutParams wl = window.getAttributes();
wl.x = 0;
wl.y = DensityUtil.getScreenHeight();//这里是获取屏幕的高

dialog.onWindowAttributesChanged(wl);//设置显示位置
 
  
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DensityUtil.dip2px(285),DensityUtil.dip2px(179));
dialog.setContentView(dialogView, params);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.show();

你可能感兴趣的:(android)