我想通过图像视图自定义我自己的进度条。我想在一个循环中每秒更换一次图像视图25次,以创建一个运动图像。我怎样才能切换图像?用imageview自定义进度条
2
A
回答
1
你可以用普通的progressBar来做到这一点吧 - 在你的drawables文件夹中设置一个animationDrawable,如下所示:(从animationDrawable上的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();
免责声明 - 我没有测试过这一点,但我不明白为什么这是行不通的。
0
有关自定义进度条的简单教程的链接 custom progress bar
相关问题
- 1. Android - 自定义进度条
- 2. 自定义进度条
- 3. 自定义平进度条
- 4. Webapp - 自定义进度条
- 5. 自定义自动完成进度条
- 6. 实现android自定义进度条
- 7. ios中的自定义进度条
- 8. Bootstrap 4 - 自定义进度条
- 9. 自定义进度条在android
- 10. xaml自定义进度条与图像
- 11. Android自定义进度条操作
- 12. 自定义jQuery UI的进度条
- 13. 自定义多色进度条
- 14. 如何实现自定义进度条
- 15. .NET中的自定义进度条CF
- 16. 自定义图片进度条(〜圈)
- 17. 自定义水平进度条
- 18. 自定义对话框进度条
- 19. 在nsis中自定义进度条
- 20. ios自定义进度条设计
- 21. Phonegap&Jquery - 自定义进度条
- 22. Android自定义进度条组件
- 23. Android:自定义水平进度条
- 24. 自定义进度条bootsrap。填充点
- 25. WPF自定义进度条裁剪
- 26. 自定义进度条上的JS
- 27. 更新Shiny-R自定义进度条
- 28. 自定义进度条(无图像)
- 29. 创建自定义进度条
- 30. 自定义形状进度条