ProgressBar播放动画

1.

布局文件中

   <ProgressBar 
		android:id="@+id/ProgressBar01" 
		style="@style/animStyle"     
		android:layout_width="250dip"
		android:layout_height="300dip"
		android:layout_marginLeft="27dip"
		/>

 

2.

styles.xml

<?xml version="1.0" encoding="UTF-8"?> 
<resources>


<style name="animStyle" parent="@android:style/Widget.ProgressBar.Large"> 
        <item name="android:indeterminateDrawable">@anim/loading_anim</item>   
    </style>

</resources>

 

3.

loading_anim.xml

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
				android:oneshot="true"
				>
	<item android:drawable="@drawable/loading_pic0001" android:duration="85"/>
	<item android:drawable="@drawable/loading_pic0002" android:duration="85"/>
	<item android:drawable="@drawable/loading_pic0003" android:duration="85"/>
	<item android:drawable="@drawable/loading_pic0004" android:duration="85"/>
	<item android:drawable="@drawable/loading_pic0005" android:duration="85"/>
	<item android:drawable="@drawable/loading_pic0006" android:duration="85"/>
</animation-list>
 

你可能感兴趣的:(ProgressBar)