0
我有一個按鈕,我想給它一些動畫。一切工作正常,但我想找出一種方法來扭轉動畫的圖像序列順序,使按鈕似乎恢復其以前的狀態。我在文檔中找不到任何內容,似乎可能無法翻轉圖像序列? 如果無法扭轉順序,我該如何給按鈕設置不同的圖像序列?我應該用一個新的陣列來堆放它嗎?圖像序列的逆向動畫?
DA代碼:
animatedButton = [[UIImageView alloc] initWithFrame:animButtonRect];
[animatedButton setImage:[UIImage imageNamed:@"messaging_00014.png"]];
[animatedButton setUserInteractionEnabled:YES];
animatedButton.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"mov_00000.png"],
[UIImage imageNamed:@"mov_00001.png"],
[UIImage imageNamed:@"mov_00002.png"],
[UIImage imageNamed:@"mov_00003.png"],
[UIImage imageNamed:@"mov_00004.png"],
[UIImage imageNamed:@"mov_00005.png"],
[UIImage imageNamed:@"mov_00006.png"],
[UIImage imageNamed:@"mov_00007.png"],
[UIImage imageNamed:@"mov_00008.png"],
[UIImage imageNamed:@"mov_00009.png"],
[UIImage imageNamed:@"mov_00010.png"],
[UIImage imageNamed:@"mov_00011.png"],
[UIImage imageNamed:@"mov_00012.png"],
[UIImage imageNamed:@"mov_00013.png"],
[UIImage imageNamed:@"mov_00014.png"],
nil];
animatedButton.animationDuration = 1.0;
animatedButton.animationRepeatCount = 1;
[self.view addSubview:animatedButton];
你就不能使用具有這些圖像的陣列供給它以相反的順序? – rdelmar
是的,我就是這麼做的。 – Ted