The project needs to display the data load using a circular progress bar, so two steps are required
1: Custom ProgressBar scrolling picture
2: Rotate the picture at a constant speed
Step one: Customize ProgressBar pictures
<progressbar android:id= "@+id/head_progressbar" android:layout_width= "Wrap_content" android: layout_height= "Wrap_content" android:layout_gravity= "center" android:indeterminatebehavior= "cycle" android:indeterminatedrawable= "@drawable/default_ptr_rotate" Picture resource android:indeterminate= "false"/>
Step 2: Rotate the picture at a constant speedPull_pro_anim.xml
<?xml version= "1.0" encoding= "Utf-8"? ><rotate xmlns:android= "Http://schemas.android.com/apk/res/android" android:duration= " android:fromdegrees=" 0 " android:pivotx=" 50% " android:interpolator=" @ Android:anim/linear_interpolator " android:pivoty=" 50% " android:repeatcount="-1 " Android:repeatmode = "Restart" android:todegrees= ">" </rotate>
Use
Progress.startanimation (Animationutils.loadanimation (GetContext (),
R.anim.pull_pro_anim));
Because the project needs, by the way also implemented the ListView drop-down refresh, pull-up refresh function git address: https://github.com/cml8655/petsworld.git Pullflushlistview Project
Not well written, please advise!
Android ProgressBar custom Picture constant rotation