android Dialog弹在底部核心代码

Window dialogWindow = switch_camera_dialog.getWindow();
            WindowManager.LayoutParams lp = dialogWindow.getAttributes();
            //dialogWindow.setGravity(Gravity.LEFT | Gravity.TOP);
            lp.width = LayoutParams.MATCH_PARENT;
            lp.height = LayoutParams.WRAP_CONTENT;
            lp.gravity = Gravity.BOTTOM;
            dialogWindow.setAttributes(lp);


你可能感兴趣的:(android日常随笔,View,android,布局,app)