2011-08-15 40 views

回答

0

據我知道的iPhone SDK沒有做,你必須自己通過的UIView

2

的iOS做動畫的.gif文件不支持gif animaiton。你必須做到這一點,像這樣 -

-(void)startImageViewAnimation 
{ 
NSArray *animationImages = [NSarray arrayWithObjects:[UIImage imageNamed:@"1.png"], 
[UIImage imageNamed:@"2.png"], 
[UIImage imageNamed:@"3.png"],nil]; 

UIImageView *imageView = [UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)]; 
imageView.animationImages = animationImages ; 
imageView.animationRepeatCount = 2; 
imageView.animationDuration= 4.0; 
[imageView startAnimating]; 

[NSTimer scheduledTimerWithTimeInterval:4.0 target:self 
selector:@Selector(animationDone:) 
userInfo:nil repeats:NO]; 
} 

-(void)animationDone:(NSTimer*)inTimer 
{ 
[inTimer invalidate]; 
inTimer = nil; 
NSLog(@"animationDone "); 
} 
+0

謝謝你,我必須在每一個細胞ImageViewAnimation,它的意思是我必須同時建立這麼多NSTimer? – Allren