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