【发布时间】:2017-07-20 08:56:19
【问题描述】:
你好在我的应用程序中我有简单的progressDialog。我使用一些简单的代码来管理它的颜色,但是低于 21 的 api 存在问题。
通常应该是这样的
但对于较低的 api 它看起来
有办法让它看起来像第一张图片吗?
我的progressDialog代码
@Override
public Dialog onCreateDialog(int dialogId) {
switch (dialogId) {
case PLEASE_WAIT_DIALOG:
final ProgressDialog dialog = new ProgressDialog(this,R.style.AppCompatAlertDialogStyle);
dialog.setTitle(getResources().getString(R.string.dialogWysylka));
dialog.setMessage(getResources().getString(R.string.dialogWysylkaDol));
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(false);
return dialog;
}
和用于管理颜色的 xml:
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/white</item>
<item name="android:textColorPrimary">@color/white</item>
<item name="android:textColor">@color/white</item>
<item name="android:background">@color/brownmuseum</item>
</style>
【问题讨论】:
标签: android api colors customization progressdialog