2012-04-26 115 views

回答

0

使用UIImageView並將animationImages屬性設置爲圖像數組。您可以設置持續時間並調用startAnimating。

Apple docs UIImageView

+0

我只有一個圖像。 – Marnerk 2012-04-26 18:51:41

+0

這是一個簡單的背景... – Marnerk 2012-04-26 18:52:40

+0

明白了! \t'UIImageView * _backgroundView = [[[UIImageView alloc] initWithImage:smoke] autorelease]; _backgroundView.frame = frame; [self.view addSubview:_backgroundView]; [UIView beginAnimations:@「skyAnimated」context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:0]; _backgroundView.frame = CGRectMake(_backgroundView.frame.origin.x + 100, \t \t \t \t \t \t \t \t _backgroundView.frame.origin.y - 1000, \t \t \t \t \t \t \t \t _backgroundView.frame.size .WIDTH, \t \t \t \t \t \t \t \t _backgroundView.frame.size.height); [UIView commitAnimations];' – Marnerk 2012-04-27 15:27:00