<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/spinner_inner" />
<item>
<rotate
android:fromDegrees="0"
android:interpolator="@android:anim/linear_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" >
<bitmap
android:antialias="true"
android:filter="true"
android:src="@drawable/spinner_outer" />
</rotate>
</item>
</layer-list>
-------
<style name="Spinner">
<item name="android:indeterminate">true</item>
<item name="android:indeterminateDrawable">@drawable/spinner</item>
<item name="android:indeterminateDuration">2000</item>
<item name="android:indeterminateOnly">true</item>
</style>
<style name="ListSpinner" parent="Spinner">
<item name="android:layout_width">64dp</item>
<item name="android:layout_height">64dp</item>
</style>
塞给progressbar即可
<ProgressBar
android:id="@+id/testImageView"
style="@style/ListSpinner"
android:layout_centerInParent="true" />
网友评论