1

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);

画像を1秒間回転させ、元の位置に戻します。(0,90.180.270,360)度のように、画像を継続的にクリックして回転させる方法はありますか。

4

1 に答える 1

3

次のようにこれらのパラメータを設定します。

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

Android開発者リファレンスから:

fillAfterがtrueの場合、このアニメーションが実行した変換は、終了しても持続します。

于 2012-06-04T00:23:50.607 に答える