我正在尝试动画化一系列图像。忽略动画ImageView的持续时间
图像之间的变化并不一定有一个动画,但我使用动画来控制时间:
-(void)nextImage
{
[UIView animateWithDuration:0.5 animations:^{
self.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"myImage%d",index++]];
}completion:^(BOOL completed){
if (index < 50)
{
[self nextImage];
}
}];
}
图像被改变,但无论我在持续使用,它忽略时间并尽可能快地进行。
如果我改变α,同样的情况:
-(void)nextImage
{
[UIView animateWithDuration:0.5 animations:^{
self.imageView.alpha = 1 - index++/100
}completion:^(BOOL completed){
if (index < 50)
{
[self nextImage];
}
}];
}
好吧,但为什么动画的阿尔法不工作? – ReloadC
看到我的答案... –