答案 0 :(得分:2)
You can define gravity for an alert dialog by using following piece of code.
WindowManager.LayoutParams wmlp = resolutionDialog.getWindow().getAttributes();
wmlp.gravity = Gravity.TOP | Gravity.LEFT;
wmlp.x = 0; // specify x axis position
wmlp.y = 0; // specify y axis position
yourDialog.show();