2012-12-20 98 views
0

我有三個圖像和1個imageview,我想逐個顯示每個圖像,並在3秒後在imageview中重複。任何一個人可以給我一些建議或鏈接?提前致謝特定時間後的圖像更改

回答

1

爲此,您可以使用UIImageView的動畫功能。

// create the view that will execute our animation 
UIImageView *campFireView = [[UIImageView alloc] initWithFrame:self.view.frame]; 

// load all the frames of our animation 
campFireView.animationImages = [NSArray arrayWithObjects: 
          [UIImage imageNamed:@"yourImage01.png"], 
          [UIImage imageNamed:@"yourImage02.png"], 
          [UIImage imageNamed:@"yourImage03.png"], 
          nil]; 

// all frames will execute in 3 seconds 
campFireView.animationDuration = 3; 
// repeat the annimation forever 
campFireView.animationRepeatCount = 0; 
// start animating 
[campFireView startAnimating]; 
//Add imageView to view 
[self.view addSubview:campFireView]; 

入住這tutorial

2

您可以使用NStimer方法控制一段時間後的更改。嘗試着解決它。