1.  Dialog dialog=new Dialog(DialogButton.this); 
  2.                  
  3.                 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉dialog的标题 
  4.                 dialog.setContentView(R.layout.dialog); 
  5.                  
  6. Window mwindow=dialog.getWindow(); 
  7. WindowManager.LayoutParams lp=mwindow.getAttributes(); 
  8. lp.x=50
  9. lp.y=50
  10. mwindow.setAttributes(lp); 
  11. dialog.show(); 

dialog都是以屏幕中心为(0,0)的