2

アニメーション中の CPU 負荷が非常に高い (最大 75%)

CPU負荷を下げるためにコードを最適化する方法はありますか?

私のコード:

ImageView myImageView = (ImageView)findViewById(R.id.ImageView02);

    animSet = new AnimationSet(true);

    animSet.setInterpolator(new LinearInterpolator());
    animSet.setFillAfter(true);
    animSet.setFillEnabled(true);

    final RotateAnimation animRotate = new RotateAnimation(0.0f, 360.0f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animRotate.setRepeatCount(Animation.INFINITE);
    animRotate.setDuration(rotor_duration());
    animRotate.setFillAfter(true);
    animSet.addAnimation(animRotate);

    myImageView.startAnimation(animSet);
4

1 に答える 1

0

回転間に遅延を設定する方法はありますか? 遅延を設定し、角度に大きな値を設定すると(回転速度を一定に保つために)役立ちます。

于 2011-05-13T07:54:00.370 に答える