在style.xml中设置
<style name="myDialog_style" parent="@android:style/Theme.Holo.DialogWhenLarge">
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
在 .java文件引用
AlertDialog dialog = new AlertDialog.Builder(context,R.style.myDialog_style).create();
dialog.show();
dialog.setContentView(R.layout.view_shop_alis);
或者这样
Dialog dialog = newDialog(context,R.style.myDialog_style);
dialog.show();
dialog.setContentView(R.layout.view_shop_alis);