Creating a 3D flip animation in Android using XML

后端 未结 8 1777
萌比男神i
萌比男神i 2020-12-22 20:25

I have created a 3D flip of a view using this android tutorial However, I have done it programmatically and I would like to do it all in xml, if possible. I am not talking

8条回答
  •  情深已故
    2020-12-22 20:40

    Just put the view which you're going to animate it in place of viewToFlip.

    ObjectAnimator flip = ObjectAnimator.ofFloat(viewToFlip, "rotationY", 0f, 360f); // or rotationX
    flip.setDuration(2000); // 2 seconds
    flip.start();
    

提交回复
热议问题