custom ProgressBar|动画 旋转


图片素材:颜色渐进的圈圈图片loading01.png


定义动画XML:

<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/loading01" android:pivotX="50%"
	android:pivotY="50%" />
android:pivotX指的是相对于起始X坐标的位置。


调用该ProgressBar的XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
	android:layout_width="wrap_content" android:layout_height="wrap_content"
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical" android:gravity="center" android:clickable="true">
	<ProgressBar android:indeterminateDrawable="@drawable/my_progress_indeterminate"
		android:layout_height="30dp" android:layout_width="30dp"></ProgressBar>
</LinearLayout>

参考

http://www.hrupin.com/2011/09/how-to-make-custom-indeterminate-progressbar-in-android-or-how-to-change-progressbar-style-or-color

你可能感兴趣的:(custom ProgressBar|动画 旋转)