android 自定义 ProgressDialog 在5.0以上出现白色背景的解决方法
2017-09-11 17:29
726 查看
需要自定义样式:
然后在带样式参数的构造方法中设置样式:
<style name="myDialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> </style> <style name="myProgressDialog" parent="@style/myDialog"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item> </style>
然后在带样式参数的构造方法中设置样式:
public SimpleProgressDialog(Context context) { super(context, R.style.myProgressDialog); this.context = context; this.setIndeterminate(true); this.setCancelable(true); this.getWindow().setGravity(Gravity.CENTER); }
相关文章推荐
- android 5.0及以上,seekbar thumb 透明效果出现父布局背景颜色的解决方法
- android 5.0及以上,seekbar thumb 透明效果出现父布局背景颜色的解决方法
- Android 5.0 自定义dialog 背景不透明解决方法
- Eclipse导入android项目出现Android requires .class compatibility set to 5.0解决方法
- Android 录音实现方法、仿微信语音、麦克风录音、发送语音、解决5.0以上BUG
- (转)解决Android 5.0以上版本Button自带阴影效果的方法
- Android-5.0中自定义SeekBar的滑块颜色后,发现有白色背景-解决方案
- android应用启动显示白色背景的解决方法
- Android自定义照相机Camera出现黑屏的解决方法
- Android 5.0以上Toast不显示的解决方法
- Android实现录音方法(仿微信语音、麦克风录音、发送语音、解决5.0以上BUG)
- android 5.0以上使用AlertDialog出现未充满屏幕的灰色背景
- 解决Android 5.0以上版本Button自带阴影效果的方法
- 解决Android 5.0以上版本Button自带阴影效果的方法
- 解决Android 5.0以上版本Button自带阴影效果的方法
- Android 5.0以上加slidingmenu后页面不刷新解决方法
- 解决Android 5.0网络信号出现感叹号的解决方法
- [置顶] Android自定义View出现android.view.InflateException的一种解决方法
- 解决Android 5.0以上版本Button自带阴影效果的方法
- ListView的ITEM点击出现白色背景的解决方法