android - 旋转二维图像onclick android

标签 android imageview scale degrees

我想旋转 imageView 的图像,我已经使用矩阵缩放图像但旋转有问题,我正在使用代码...

int previousDegrees = 0;
        int degrees = 90;
        RotateAnimation animation = new RotateAnimation(previousDegrees,degrees,160,160);
        ImageView imageView = (ImageView)findViewById(R.id.imageView);
        animation.setDuration(1000);//Set the duration of the animation to 1 sec.
        imageView.startAnimation(animation);

它旋转图像一秒钟然后退回到原来的位置..有什么方法可以让图像连续旋转onclick..就像在(0,90.180.270,360)度... 请任何帮助!

最佳答案

像这样设置这些参数:

    animation.setFillEnabled(true);
    animation.setFillAfter(true);

来自 Android Developers Reference :

If fillAfter is true, the transformation that this animation performed will persist when it is finished.

关于android - 旋转二维图像onclick android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10875046/

相关文章:

安卓工作室 : Bitmap to ImageView Error

docker - Docker群

java - Android:放大但保持元素的比例

android - 如何在某个时候取消android中以前的 Activity ?

Android 直方图均衡算法给了我真正明亮或红色的图像

android - 每秒精确播放声音

java - 在 Android 上移动 ImageView

android - Android/iOS 上的 Base64 编码图像

android - 将从相机拍摄的图像设置为 ImageView

r - ggplot2 scale_x_continuous 限制或绝对