1 // 实例化布局文件 2 View delete_view = View.inflate(getApplicationContext(), R.layout.deleta_view, null); 3 // 实例化 Dialog 4 Dialog dialog = new Dialog(MainActivity.this); 5 // 获取窗口管理器 6 Window dialogWindow = dialog.getWindow(); 7 // 隐藏标题栏 8 dialogWindow.requestFeature(Window.FEATURE_NO_TITLE); 9 // 设置显示的View 10 dialogWindow.setContentView(delete_view); 11 // 设置显示的位置 12 dialogWindow.setGravity(Gravity.BOTTOM); 13 dialog.show();