在android中如何通过Y轴旋转视图?

在android中如何通过Y轴旋转视图?,android,animation,view,rotation,Android,Animation,View,Rotation,在我的应用程序中,我想通过setRotationY()旋转ImageView。事实上,确实如此。就像从b到d,镜像效果一样,当我在setRotationY()之前使用setRotationY(45)时,结果是setRotationY根据设备Y轴,我希望rotationY根据视图本身 怎么做?你能指引我吗? 谢谢 显然,你可以把你的图像视图放在那里谢谢你的回答,加伯。但是在启动animator之前设置旋转,结果不是我期望的..谢谢@Dmitry。简单最好的回答谢谢,很好的回答你找到答案了吗?还没有

在我的应用程序中,我想通过
setRotationY()
旋转
ImageView
。事实上,确实如此。就像从b到d,镜像效果一样,当我在
setRotationY()
之前使用
setRotationY(45)
时,结果是
setRotationY
根据设备
Y轴
,我希望
rotationY
根据视图本身

怎么做?你能指引我吗? 谢谢


显然,你可以把你的图像视图放在那里

谢谢你的回答,加伯。但是在启动animator之前设置旋转,结果不是我期望的..谢谢@Dmitry。简单最好的回答谢谢,很好的回答你找到答案了吗?还没有。。。。我用比例(0,-1)代替
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);