如何申请定制微调形象进度在android的对话框对话框、进度、形象、android

由网友(凉ヽ梦)分享简介:您好我特林应用自定义微调图像进步dialod android的我为此目的而使用.gif文件,而我应用它,通过这个code,hi i tring to apply custom spinner image to progress dialod in android i use a .gif file for this...

您好我特林应用自定义微调图像进步dialod android的我为此目的而使用.gif文件,而我应用它,通过这个code,

hi i tring to apply custom spinner image to progress dialod in android i use a .gif file for this purpose,and i apply it through this code,

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();

通过这个code微调图像改为bar.gif,但没有转动, 请您帮我什么是错,由于这方面的帮助是很大的AP preciated。

through this code Spinner image changed to bar.gif but it is not spinning, please kindly help me whats wrong with this,thanks any help in this regard is greatly appreciated.

推荐答案

在Android上,gif动画不能在ImageView的工作。你需要给他们发挥的电影如由样品ApiDemos。

In Android, animated gif don't work in ImageView. You need to play them as movies as shown by the sample ApiDemos.

但你可以爆炸的GIF在multple文件,并创建一个动画的ressource文件。 动画文件是描述可拉伸的清单,以显示与每帧的持续时间(或变换来适用,如果可以使用它们)的xml文件。 你可以阅读在这里的官方文档的详细信息: http://developer.android.com/guide/topics/resources/animation-resource.html#Frame

But you can explode your gif in multple files and create an animation ressource file. An animation file is an xml file describing the list of drawable to display and the duration of each frame (or the transformations to apply if you can use them). You can read the details in the official documentation here: http://developer.android.com/guide/topics/resources/animation-resource.html#Frame

那么这绘制应该在ProgressDialog很好地工作。

This drawable should then work nicely in your ProgressDialog

阅读全文

相关推荐

最新文章