开发者

High cpu load during animation

During the animation the cpu load is very high (up to 75%)

Is there a method to optimize the code to get lower cpu load?

My code:

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


Is there a method to set delay between rotations ? By setting a delay and setting a bigger value for the angle (to keep rotation speed constant) should help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜