我想通过图像视图自定义我自己的进度条。我想在一个循环中以每秒25次的速度改变图像视图,以便创建一个运动图像。如何进行镜像的切换?
发布于 2012-04-02 01:55:52
你可能只需要使用普通的progressBar -在你的drawables文件夹中设置一个animationDrawable,如下所示:(取自animationDrawables上的android docs )。
<!-- Animation frames are wheel0.png -- wheel5.png files inside the
res/drawable/ folder -->
<animation-list android:id="selected" android:oneshot="false">
<item android:drawable="@drawable/wheel0" android:duration="50" />
<item android:drawable="@drawable/wheel1" android:duration="50" />
<item android:drawable="@drawable/wheel2" android:duration="50" />
<item android:drawable="@drawable/wheel3" android:duration="50" />
<item android:drawable="@drawable/wheel4" android:duration="50" />
<item android:drawable="@drawable/wheel5" android:duration="50" />
</animation-list>然后在你的代码中的某处:
AnimationDrawable progress = (AnimationDrawable) mProgressBar.getProgressDrawable();
progress.start();免责声明-我没有测试过这个,但我不明白为什么它不能工作。
发布于 2013-03-17 01:52:31
有关自定义进度条custom progress bar的简单教程的链接
https://stackoverflow.com/questions/9966512
复制相似问题