如何改变Android的不确定进度条的颜色?不确定、进度条、颜色、Android

2023-09-12 08:26:35 作者:独闯天下

我在找一个很明显的事情(在其他语言!!),它使我疯了!

I'm looking for a very obvious thing (in other languages !!) and it drives me crazy !

我想知道怎样才能从基础上白/灰颜色改为不确定进度颜色为黑色?当我改变indeterminateDrawable,我得到一个静态图像,而不是移动的动画的进度。有没有办法做到这一点简单的XML?

I would like to know how I can change indeterminate ProgressBar color from basis white/grey color to black ? When I change the indeterminateDrawable, I get a static image instead of a moving animated progressBar. Is there any way to do it simply in xml ?

感谢您!

推荐答案

第1步:复制绘制/ progress_indeterminate_horizo​​ntal.xml 从SDK的资源到您的项目

Step #1: Copy drawable/progress_indeterminate_horizontal.xml from your SDK's resources into your project.

步骤#2:复制绘制-华电国际/ progressbar_indeterminate * 从SDK的资源到您的项目

Step #2: Copy drawable-hdpi/progressbar_indeterminate* from your SDK's resources into your project.

第三步:复制绘制-MDPI / progressbar_indeterminate * 从SDK的资源到您的项目

Step #3: Copy drawable-mdpi/progressbar_indeterminate* from your SDK's resources into your project.

第四步:修改PNG文件,以寻找您想要的方式

Step #4: Modify the PNG files to look the way you want.

步骤#5:修改 progress_indeterminate_horizo​​ntal.xml 来指向您的PNG文件(相对于标准的)

Step #5: Modify the progress_indeterminate_horizontal.xml to point to your PNG files (versus the standard ones).

步骤#6:使用 @绘制/ progress_indeterminate_horizo​​ntal indeterminateDrawable