我有一个<layer-list>
里面有四个<item>
,在这个drawable上我有一个旋转动画。旋转动画效果很好!
问题在于我真的不知道如何放大和缩小&#34;当时<layer-list>
内的每个圈子上的动画。从左上角开始&gt;右上角&gt;左下&gt;右下&gt;然后重复。
任何?
抽拉/ progress_circle.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="0dp"
android:top="0dp"
android:right="110dp"
android:bottom="110dp"
android:drawable="@drawable/progress_circle_green_item" />
<item
android:left="110dp"
android:top="0dp"
android:right="0dp"
android:bottom="110dp"
android:drawable="@drawable/progress_circle_green_item" />
<item
android:left="0dp"
android:top="110dp"
android:right="110dp"
android:bottom="0dp"
android:drawable="@drawable/progress_circle_green_item" />
<item
android:left="110dp"
android:top="110dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/progress_circle_green_item" />
</layer-list>
动画/ progress_circle_rotate.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
android:repeatCount="infinite">
</rotate>
布局/ main.axml:
<ImageView
android:src="@drawable/progress_circle"
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
main.cs:
Animation a = AnimationUtils.LoadAnimation( this, Resource.Animation.progress_circle_rotate );
ImageView progressCircle = ( ImageView )FindViewById( Resource.Id.imageView1 );
progressCircle.StartAnimation( a );