private void showDialog(View view) {
dialog = new Dialog(mActivity, R.style.AlertDialogTheme);
dialog.setContentView(view);
display = mActivity.getWindowManager().getDefaultDisplay();
Window window = dialog.getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = (int) (display .getWidth() * 0.8);
window.setAttributes(attributes);
dialog.show();
}
<style name="AlertDialogTheme" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
至于布局、圆角就要自己写资源文件来实现了。