How To Create Custom ProgressBar Spinner Image And Rotate It Using XML In Android
Posted by blogmeister on
January 22, 2014
Here is my XML file to rotate an image in 360 degree movement.
|
1 2 3 4 5 6 7 |
<rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/rotate" android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0" android:toDegrees="720" /> |
To apply it to the ProgressBar and use it as the moving spinner, do it like this:
|
1 2 3 4 |
<ProgressBar style="?android:attr/progressBarStyleSmall" .... android:indeterminateDrawable="@drawable/progressbar_spinner_rotate" /> |
I have read some posts in forums that they had issues with the smoothness of the rotating animation. In my case, I did not see any issue with it. Perhaps old versions of the Android operating system contributed as a factor? I tested this with JellyBean and it worked out quite fine.
Share the post "How To Create Custom ProgressBar Spinner Image And Rotate It Using XML In Android"












