在动画期间,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);
答案 0 :(得分:0)
有没有一种方法来设置旋转之间的延迟?通过设置延迟并设置较大的角度值(以保持转速恒定)应该有所帮助。