- Dialog dialog=new Dialog(DialogButton.this);
- dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉dialog的标题
- dialog.setContentView(R.layout.dialog);
- Window mwindow=dialog.getWindow();
- WindowManager.LayoutParams lp=mwindow.getAttributes();
- lp.x=50;
- lp.y=50;
- mwindow.setAttributes(lp);
- dialog.show();
dialog都是以屏幕中心为(0,0)的
转载于:https://blog.51cto.com/yeelone/562289