如何在Android中旋转Y轴视图?

Guu*_*Guu 4 animation android view rotation

在我的应用程序,我想旋转的ImageView通过setRotationY().事实上,确实如此.就像从b到d,镜像效果和我setRotation(45)以前使用的时候setRotationY(),结果setRotationY就是根据设备Y-axis,我希望rotationY根据视图自我.

怎么样?你能指导我吗?谢谢!

Dmi*_*kov 16

ObjectAnimator animation = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 360f);
    animation.setDuration(3600);
    animation.setRepeatCount(ObjectAnimator.INFINITE);
    animation.setInterpolator(new AccelerateDecelerateInterpolator());
    animation.start();
Run Code Online (Sandbox Code Playgroud)