iOS2.0以後就有了怎麼一直都不知道
效果同等於android的 animation-list
開storyboard,拉一個image view到view controller上
按住control創一個IBOutlet叫做animationImageView
在viewDidLoad放上以下code,一進入view就會看到圖片在動
用animatedImageNamed: 會load所有step_img開頭的圖片,所以只要每張圖片檔名照順序存檔(step_img0, step_img1, step_img2, step_img3 ...)拉到專案就行了
self.animationImageView.image = [UIImage animatedImageNamed:@"step_img" duration:0.5f];
[self.animationImageView startAnimating];
Source: UIImageView Animating Images
沒有留言:
張貼留言