我有一个做动画的对象...如果有许多(超过 25 个)对象同时在做动画,它会在拖动时引起混蛋...我在每个对象中使用下面的代码创建动画。我怎样才能提高性能?
#define DEFAULT_ANIM_SPPED 0.6
#define INFINATE_VALUE 1e100f
- (void)startAnimating
{
mBackgroundImageView.frame = mOriginalFrame;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationRepeatCount:INFINATE_VALUE];
[UIView setAnimationDuration:DEFAULT_ANIM_SPPED];
CGRect tempFrame=mBackgroundImageView.frame;
tempFrame.origin.y -= mAnimationOffset;
mBackgroundImageView.frame=tempFrame;
[UIView commitAnimations];
}