嗨,我试图在Android的进度对话框中应用自定义旋转器图像。我使用一个 .gif 文件来实现这个目的,并通过以下代码应用它:
dialog = new ProgressDialog(BackupRestoreActivityContext);
dialog.setCancelable(true);
dialog.setIcon(resId);
dialog.setTitle(title);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setIndeterminate(true);
dialog.setIndeterminateDrawable(BackupRestoreActivityContext.getResources().getDrawable(R.drawable.bar));
dialog.show();
通过这段代码,Spinner图像更改为bar.gif,但它没有旋转,请帮忙检查一下,谢谢。非常感谢您在此方面提供的任何帮助。