布局文件如下
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminateBehavior="repeat"
android:indeterminateDrawable="@drawable/progress_big" />
</RelativeLayout>
progress_big.xml文件:
<!--多图层图片-->
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<rotate android:drawable="@mipmap/spinner_big_inner" android:fromDegrees="1080" android:toDegrees="0"></rotate>
</item>
<item >
<rotate android:drawable="@mipmap/spinner_big_outer" android:fromDegrees="0" android:toDegrees="720"></rotate>
</item>
</layer-list>
上面引用的图片是这两张:


layer-list具有图层叠加的效果,所以只要一张图片逆时针旋转,一张图片顺时针旋转即可实现这种效果:

网友评论