我已经为进度对话框制作了自定义样式,但是它周围有奇怪的边框。
这是主题:
<style name="AppTheme.Dialog" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@android:color/white</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:background">@color/colorPrimaryDark</item>
<item name="android:popupBackground">@null</item>
</style>
知道为什么会有这么奇怪的背景吗?
最佳答案
要删除进度对话框周围的彩色或白色边框,请让对话框使用定义透明 windowBackground 的主题
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
</style>
创建对话框时使用这个主题:
new ProgressDialog(MyActivity.this, R.style.MyDialogTheme);
关于安卓 : How to get rid of weird border around progress dialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34007177/