我有一个按钮,我想给它一些动画。一切正常,但我试图找出一种方法来反转动画的图像序列顺序,以便按钮似乎恢复它的先前状态。我在文档中找不到任何内容,似乎无法反转图像序列?如果无法颠倒顺序,我怎样才能给按钮一个不同的图像序列?我应该用一个新的阵列把它收起来吗?
代码:
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];