一个图片旋转动画

动画布局

<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android">


    <rotate
        android:fromDegrees="0"
        android:toDegrees="359"
        android:duration="2000"
        android:repeatCount="-1"
        android:pivotX="50%"
        android:pivotY="50%" />

</set>


使用方法

 ImageView parkerMapLeft = ButterKnife.findById(view, R.id.img_indoor_map_left);
        Animation rotateAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.rorate_request_circle);
        LinearInterpolator lir = new LinearInterpolator();
        rotateAnimation.setInterpolator(lir);
        parkerMapLeft.startAnimation(rotateAnimation);


然后这个imageview就会自己一直转圈圈了

猜你喜欢

转载自blog.csdn.net/u013165058/article/details/52980715