android控制Dialog的位置

Window window = dialogDesc.getWindow();
                    //window.setWindowAnimations(R.style.main_menu_animstyle);// 设置显示动画
                    WindowManager.LayoutParams wl = window.getAttributes();
                    wl.x = 0;
                    wl.y = getWindowManager().getDefaultDisplay().getHeight();
                    wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
                    wl.height = ViewGroup.LayoutParams.WRAP_CONTENT;
                    dialogDesc.onWindowAttributesChanged(wl);// 设置显示位置

猜你喜欢

转载自blog.csdn.net/dubo_csdn/article/details/94739111