我想将进度条更改为自定义绘图。如何更改进度栏的图像?
最佳答案
这是我的答案,我在android进度栏中使用我的图片。
<ProgressBar
android:layout_width="60dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:indeterminate="true"
android:indeterminateDrawable="@drawable/my_progress_indeterminate" />
my_progress_indeterminate.xml:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/animation"
android:pivotX="50%"
android:pivotY="50%"/>
animation.xml:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/load" android:duration="50" />
<item android:drawable="@drawable/load" android:duration="50" />
<item android:drawable="@drawable/load" android:duration="50" />
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/load"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="330"
android:toDegrees="360"
android:repeatCount="1" />
</animation-list>