In this Android Tutorial i will tell you how to create your own custom progress bar
Below are the steps to create your own custom progress bar.
Just follow the steps :
STEP - 1)
main.xml:(add this to your main.xml):
STEP - 2)
myprogressbar.xml (save this xml in drawable folder)
Below are the steps to create your own custom progress bar.
Just follow the steps :
STEP - 1)
main.xml:(add this to your main.xml):
<ProgressBar
android:id="@+id/ProgressBar01"
android:layout_width="121dp"
android:layout_height="15dp"
android:progress="50"
android:max="100"
android:secondaryProgress="0"
style="?android:attr/progressBarStyleHorizontal"
android:progressDrawable="@drawable/myprogressbar"
android:layout_marginTop="10dp"
/>
</LinearLayout> STEP - 2)
myprogressbar.xml (save this xml in drawable folder)
<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="#C0C0C0" android:centerColor="#F8F8FF"
android:centerY="0.75" android:endColor="#ffffff" android:angle="90" />
<stroke android:width="1dp" android:color="#6B8E23" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="25dip" />
<gradient android:startColor="#9ACD32" android:endColor="#FFFF00"
android:angle="90" />
<stroke android:width="1dp" android:color="#6B8E23" />
</shape>
</clip>
</item>
</layer-list>
nice blog buddy .... realy very useful.
ReplyDeleteWelcome sumeet....
ReplyDeleteCool, ta :)
ReplyDeleteso nice.. very useful one.. can we use image instead of colors.. ??
ReplyDeleteOh yeah!
ReplyDeleteNice one..Thank You buddy..!!
ReplyDeletewelcome glad to know this helped..
ReplyDeleteseriously wtf, is this so hard to upload a screenshot ?
ReplyDelete