进度颜色进度、颜色

由网友(此刻轻数眼泪)分享简介:我想设置的进度颜色在我的默认值进度条的颜色应用是轻微的白色和我的应用程序也有白色的背景,以便它不能是可见的正确。所以,请给我对它的解决方案。谢谢你。I want to set the Progressbar Colour in My Application as Default progressbar colour...

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

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)

阅读全文

相关推荐

最新文章