如何在Android中制作自定义进度条 [英] How to make a custom progress bar in Android
问题描述
我需要帮助来制作自定义进度条.我想像这样更改库存 android 进度条:http://i56.tinypic.com/dlgbae.jpg
I need help in doing a custom progress bar. I would like to change the stock android progress bar like this one: http://i56.tinypic.com/dlgbae.jpg
像这样或任何其他形状:
To something like this or any other shape:
http://i52.tinypic.com/2r750dh.jpg
有人能指出我正确的方向吗?谢谢
Can someone point me to the right direction, please? Thanks
推荐答案
你需要为进度条加载不同的Drawable
You need to load different Drawable
for the progress bar
简单的方法就是使用
android:progressDrawable="@drawable/myprogbar_new_drawable"
要么将 PNG 放在项目的 res/drawable
文件夹中,要么创建自己的 xml 并指定颜色/渐变/形状等.
Either put PNG in res/drawable
folder in your project or create your own xml with specify colors/gradients/shapes etc.
这篇关于如何在Android中制作自定义进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!