我希望让一个UIImageView
闪烁几次。
目前我不知道怎么做。
实际代码:
-(void)arrowsAnimate{
[UIView animateWithDuration:1.0 animations:^{
arrow1.alpha = 1.0;
arrow2.alpha = 1.0;
arrow3.alpha = 1.0;
NSLog(@"alpha 1");
} completion:^(BOOL finished){
[self arrowsAnimate2];
}];
}
-(void)arrowsAnimate2{
[UIView animateWithDuration:1.0 animations:^{
arrow1.alpha = 0.0;
arrow2.alpha = 0.0;
arrow3.alpha = 0.0;
NSLog(@"alpha 0");
} completion:^(BOOL finished){;}];
}
之后我这样调用它:
for (int i = 0;i < 10; i++){
[self arrowsAnimate]; }
这给我10倍的alpha 1,然后是10倍的alpha 0。在中间我们只看到一个动画。 有任何建议吗?
谢谢。