There is a RelativeLayout with several views inside. How to make animation of rotation around the Y axis as in the picture?
1 answer
Use the ObjectAnimator class. Very easy to use
ObjectAnimator animation = ObjectAnimator.ofFloat(yourView, "rotationY", 0.0f, 360f); animation.setDuration(2400); animation.setRepeatCount(ObjectAnimator.INFINITE); animation.setInterpolator(new AccelerateDecelerateInterpolator()); animation.start(); - The code for some reason does not work, but thanks for the tip. - Alexey
- @ Alexey is working, replace the second parameter
rotationByYwithView.ROTATION_Y- ermak0ff - No, I just don’t pass on the wrong view)) It works, thank you!) - Alexey
- one@ Alexey, let's not wake people up, the option with
rotationByYdoes not work, you must either writeView.ROTATION_YorrotationYwhich in principle is equivalent to - ermak0ff
|
