In my app, i would like rotate an ImageView
by setRotationY()
. In fact, it does. Just like from b to d, mirror effect and when i use setRotation(45)
before setRotationY()
, the result is that setRotationY
is according to the device Y-axis
, and i want the rotationY
according to view self.
How? Can you guide me?
Thanks!
ObjectAnimator animation = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 360f);
animation.setDuration(3600);
animation.setRepeatCount(ObjectAnimator.INFINITE);
animation.setInterpolator(new AccelerateDecelerateInterpolator());
animation.start();
RotateAnimation rotate = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(5000);
rotate.setInterpolator(new LinearInterpolator());
ImageView image= (ImageView) findViewById(R.id.imageView);
image.startAnimation(rotate);
Obviously, you could just put your imageView there