我将[UIView animateWithDuration:...]用于UIImageView视图的动画序列。像这样:

[UIView animateWithDuration:1.0 animations:^{
    imageView.frame = newImageRectPosition;
}completion:^(BOOL finished){
 //animate next UIImageView
}];

我需要不完成动画“下一个UIImageView”。我需要在上一个动画的中间而不是在完成时为“下一个UIImageView”设置动画。有可能这样做吗?

最佳答案

您可以设置两个UIView动画块,其中一个的延迟时间是第一个动画的一半:

[UIView animateWithDuration:1.0
                 animations:^{ ... }
                 completion:^(BOOL finished){ ... }
];

[UIView animateWithDuration:1.0
                      delay:0.5
                    options:UIViewAnimationCurveLinear
                 animations:^{ ... }
                 completion:^(BOOL finished) { ... }
];

关于iphone - 在完成之前启动动画UIView吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13016147/

10-12 00:27
查看更多