2

我怎樣才能改變indetermine進度的風格的Android如何使定製不確定進度

我需要改變顏色爲紅色爲這個進度:

enter image description here

任何人可以幫助我嗎?

+1

檢查http://stackoverflow.com/questions/2638161/how-to-change-android-indeterminate-progressbar-color話題2- – evilone

回答

3

我得到了Android的源代碼,所以我看到他們是如何打造德微調裝載機,這是非常EASSY只需兩步

1 - 創建一個在您繪製文件夾中的可繪製資源與你像這樣設置(並把它命名科幻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%" /> 

在佈局

<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" />