不继承Dialog的话
Dialog myDialog = new Dialog(this, R.style.simpleDialogStyle);
myDialog.setContentView(R.layout.menu_dialog);
simpleDialogStyle
<style name="simpleDialogStyle" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
设置Dialog显示参数
Window dialog_window = myDialog.getWindow();
WindowManager.LayoutParams dialog_window_attributes = dialog_window.getAttributes();
DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
mWindowWidth = displayMetrics.widthPixels/3;
mWindowHeight = displayMetrics.heightPixels;
dialog_window_attributes.width=mWindowWidth;
dialog_window_attributes.height=mWindowHeight;
dialog_window.setAttributes(dialog_window_attributes);
//设置dialog位置为 屏幕右上
dialog_window.setGravity(Gravity.RIGHT|Gravity.TOP);