我在Fragment中使用了一个简单的Progress Dialog生成器方法:
public voID showProgressDialog(int messageID){ String message = getString(messageID); mProgressDialog = ProgressDialog.show(this.getActivity(), "", message, true);}
我的进度对话框显示如下,没有正常的填充:
我该怎么做才能在我的进度条周围设置默认填充?
编辑:添加themes.xml文件
<resources xmlns:tools="http://schemas.androID.com/tools"><style name="AppBasetheme" parent="@style/theme.AppCompat.light.NoActionbar"></style><style name="Apptheme" parent="AppBasetheme"> <item name="androID:textcolorPrimary">@androID:color/white</item> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <item name="androID:windowContentOverlay">@null</item> <item name="windowActionbar">false</item> <item name="windowNoTitle">true</item> <!-- Toolbar theme / Apply white arrow --> <item name="colorControlnormal">@androID:color/white</item> <item name="actionbartheme">@style/Apptheme.Actionbartheme</item> <!-- Material theme --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/status_bar_color</item> <item name="colorAccent">@color/accent_color</item> <item name="androID:navigationbarcolor" tools:targetAPI="21">@color/navigationbarcolor</item> <item name="androID:fitsSystemwindows">true</item> <item name="androID:windowDrawsSystembarBackgrounds" tools:targetAPI="21">true</item></style><style name="Apptheme.Actionbartheme" parent="@style/themeOverlay.AppCompat.Actionbar"> <!-- White arrow --> <item name="colorControlnormal">@androID:color/white</item></style><style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> <item name="spinbars">true</item> <item name="color">@color/drawerArrowcolor</item></style></resources>
This class was deprecated in API level 26. ProgressDialog is a modal
dialog, which prevents the user from interacting with the app. Instead
of using this class, you should use a progress indicator like
Progressbar, which can be embedded in your app’s UI. Alternatively,
you can use a notification to inform the user of the task’s progress. For more details 07001
解决方法:
这是我的解决方法,为Dialog创建一个新主题.希望它能帮到你!
<style name="ProgressDialogtheme" parent="theme.AppCompat.light.Dialog"> <item name="androID:fitsSystemwindows">false</item> <item name="androID:clipTopadding">false</item> </style> ProgressDialog progressDialog = new ProgressDialog(context, R.style.ProgressDialogtheme); progressDialog.setProgressstyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage(content); progressDialog.show();
总结 以上是内存溢出为你收集整理的android – 没有填充的进度对话框全部内容,希望文章能够帮你解决android – 没有填充的进度对话框所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)