Create a one folder name as Drawable and create another xml in that folder
res/drawable/myprogressbar.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="25dip" />
<gradient android:startColor="#000000" android:endColor="#000000" />
<shape>
<corners android:radius="25dip" />
<gradient android:startColor="#000000" android:endColor="#000000" />
<stroke android:width="1dp" android:color="#000000" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="35dip" />
<gradient android:startColor="#990000" android:endColor="#E6E8FA" />
<!--
<stroke android:width="1dp" android:color="#6B8E23" />
-->
</shape>
</clip>
</item>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="35dip" />
<gradient android:startColor="#990000" android:endColor="#E6E8FA" />
<!--
<stroke android:width="1dp" android:color="#6B8E23" />
-->
</shape>
</clip>
</item>
</layer-list>
this xml files can show the loading progress bar in a color.
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ProgressBar android:layout_marginLeft="5dp" android:layout_width="250dp" android:progressDrawable="@drawable/myprogressbar" android:id="@+id/progressBar1" android:layout_marginBottom="90dp" android:layout_marginRight="10dp" style="?android:attr/progressBarStyleHorizontal" android:layout_height="wrap_content"></ProgressBar>
</LinearLayout>

0 komentar:
Posting Komentar