创建AlertDialog的时候会出现黑边,可以在new的时候设置style,style代码如下:
AlertDialog.Builder builder = new AlertDialog.Builder(
new ContextThemeWrapper(this, R.style.Theme_Transparent));
<style name="Theme_Transparent" parent="@android:Theme.DeviceDefault.Light.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
另外还可以直接new dialog,而不是AlertDialog,这样也不会出现黑边的情况