我有兩個圖像的圖像陣列,重複做一隻鳥拍動翅膀。如何使圖像陣列移動?
如何讓陣列移動?
我有這樣的數組:
NSArray *imageNames = @[@"bird1.png", @"bird2.png"];
NSMutableArray *birdflapping = [[NSMutableArray alloc] init];
for (int i = 0; i < imageNames.count; i++) {
[birdflapping addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(60, 95, 86, 193)];
animationImageView.animationImages = birdflapping;
animationImageView.animationDuration = 1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
我怎樣才能使數組(作爲一個整體)移動?
什麼意思爲數組動?從數組中刪除或動畫移動? – simalone