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