0
我有一个做动画的对象......如果有很多(超过25个)对象同时做动画,它在拖动时会造成混乱...我在每个对象中使用下面的代码创建动画。我该如何提高性能?许多UIView动画导致性能问题?
#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];
}
Superview有其他东西是不可动画的... – 2011-02-10 10:40:34