How Do I Use 'RotateDrawable'?

后端 未结 7 2143
没有蜡笔的小新
没有蜡笔的小新 2020-12-15 19:34

Could anyone tell me how they have got \'RotateDrawable\' to work whether it be from code or XML or both? The documentation on animating Drawables is pretty poor and animati

7条回答
  •  旧巷少年郎
    2020-12-15 20:08

    You have to animate the "level" property, where 0 is the start value and 10000 is the end value.

    The below example animates from start to finish, you can reverse the animation easily with this method.

    final RotateDrawable rotateDrawable = ...
    ObjectAnimator.ofInt(rotateDrawable, "level", 0, 10000).start();
    

提交回复
热议问题