android - 动画期间的高 CPU 负载

标签 android animation image-rotation

在动画期间 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);

最佳答案

有没有办法设置旋转之间的延迟?通过设置延迟并设置更大的角度值(以保持旋转速度恒定)应该会有所帮助。

关于android - 动画期间的高 CPU 负载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5988779/

相关文章:

java - Android onAnimationEnd 删除 View (自身)不删除

reactjs - 使用 React Native 在 Logo 点击上来回旋转动画

html - CSS - 在图像顶部旋转文本

jquery - 需要旋转图像的总宽度

android - 我如何在没有星期六和星期日的情况下获取一周中所有日期的名称以及一周中的所有日期?

Java,通过反射记录方法名称

android - 如何将 eclipse 库项目从 github 导入到 android studio 项目?

Android - 录制声音并检查音量

c# - WPF 动画时钟什么都不做?

android - 如何使 android 中的偏心旋转动画在纵向和横向上看起来相似?