我想通过单击我的按钮来旋转我的图像视图。 我想要这个: 当用户点击按钮,旋转图像视图90度。 再次点击我的按钮时,将图像视图旋转180度。 再次点击我的按钮时,将图像视图旋转270度。 当再次点击我的按钮时,旋转图像视图0度。 这继续这样下去...... 我可以正常旋转我的形象视图只是一个随时间90度这段代码:通过单击按钮来旋转图像视图
mImageView.setRotation(0);
,并通过这个我可以旋转90度,并返回到0度。
float deg = (mImageView.getRotation() == 90F) ? 0F : 90F;
mImageView.animate().rotation(deg).setInterpolator(new AccelerateDecelerateInterpolator());
我该怎么办?
检查此链接也可能会得到答案http://stackoverflow.com/a/18016331/4069985 [当点击 –
可能的复制一个按钮在android中顺时针旋转图像](http://stackoverflow.com/questions/18016126/when-click-a-button-rotate-image-clockwise-in-android) –