How can I change the color of the ProgressBar?

I change the color of the ProgressBar to red and it turns orange.

ProgressBar
<ProgressBar android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/progressBar" style="@android:style/Widget.ProgressBar.Horizontal" android:progressDrawable="@drawable/progressBarDraw" android:layout_marginTop="15dip" />

Drawable
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@android:id/background"> <shape> <corners android:radius="5dip" /> <stroke android:width="5dip" android:color="#ffffff" /> <solid android:color="#ffffff" /> </shape> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="5dip" /> <stroke android:width="5dip" android:color="#ff009900" /> <solid android:color="#ff009900" /> </shape> </clip> </item> </layer-list>

Fragment
private void UpdateProgressBar(float percent, Color color) { _progressView.Progress = (int)(percent * 100); _progressView.ProgressDrawable.SetColorFilter(color, PorterDuff.Mode.Screen); //_progressView.SetBackgroundColor(color); }

Sign In or Register to comment.