进度颜色 [英] ProgressBar Colour

查看:148
本文介绍了进度颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置的进度颜色在我的默认值进度条的颜色应用是轻微的白色和我的应用程序也有白色的背景,以便它不能是可见的正确。 所以,请给我对它的解决方案。谢谢你。

I want to set the Progressbar Colour in My Application as Default progressbar colour is Slight White and My Application also has the White background so it cant be visible properly. So Please give me the Solution for it. Thanks.

推荐答案

@Chirag:我不认为这将是足够的呢?您的code可能会设置一个渐变的背景,但白色的微调仍然会在这里。

@Chirag : I don't think that will be enough is it ? Your code will probably set a gradient at the background but the white spinner will still be here.

我所做的让我自定义的微调工作是制定与背景绘制(图像或形状),一个进度条。该进度条动画这里叫做Java编写的。

What I did to get my custom spinner working was to set a ProgressBar with a background drawable (image or shape). The ProgressBar animation is here called in Java.

<ProgressBar
     android:id="@+id/ProgressBar01" 
     android:layout_width="40px"
     android:layout_height="40px"
     style="?android:attr/progressBarStyle"
     android:indeterminateOnly="false"
     android:background ="@drawable/spinner_blue_76"
     />

splash_spinner.xml

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:fromDegrees="0"
    android:toDegrees="359"
    android:duration="1000"
    android:repeatMode="restart"
    android:repeatCount="infinite"
    android:interpolator="@android:anim/linear_interpolator">
</rotate>

LauncherActivity

    ...
    ProgressBar t = (ProgressBar) findViewById(R.id.ProgressBar01);
    t.startAnimation(AnimationUtils.loadAnimation(this,R.anim.splash_spinner));
    ...

spinner_blue_76 (或其他)

这可能不是正确的方法要么但它运作良好。 (我现在有一个蓝色的微调对我的灰色背景)

It might not be the proper way either but it works well. (I have now a blue spinner on my grey background)

这篇关于进度颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆