Question

How can I change style of indetermine ProgressBar in Android

I need to change color to RED for this progressbar:

enter image description here

Can anybody help me?

Was it helpful?

Solution

I got the android source code so I saw how they build de spinner loader, and it's very eassy just two steps

1- create a drawable resource in your drawable folder with you image like below (and named it f.i my_loader)

<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/your_image_loader"
    android:pivotX="50%"
    android:pivotY="50%" />

2- in your layout

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:orientation="vertical" >

    <ProgressBar
        android:id="@+id/progressBar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:indeterminateDrawable="@drawable/my_loader" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top