这是我从底部尝试对话的方法
dialog = new Dialog(activity, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.coachingtip_discover);
ImageView imageclose = (ImageView) dialog.findViewById(R.id.btn_close1);
TextView textsmg = (TextView) dialog.findViewById(R.id.discover_inspire_text);
TextView textsmg2 = (TextView) dialog.findViewById(R.id.add_photo_text2);
TextView textsmg3 = (TextView) dialog.findViewById(R.id.add_photo_text1);
dialog.show();
答案 0 :(得分:0)
这是您在底部呈现Dialog
的方式:
dialog = new Dialog(activity, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.coachingtip_discover);
Window window = dialog.getWindow();
WindowManager.LayoutParams wlp = window.getAttributes();
wlp.gravity = Gravity.BOTTOM;
wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;
window.setAttributes(wlp);