我有一组图像,我想让UIImageView动画
我知道如何使用此方法执行此操作:
[myImageView setAnimationImages:myImageArray];
[myImageView setAnimationDuration:.7];
[myImageView setAnimationRepeatCount:1];
[myImageView startAnimating];
但是我想使用不同的方法。我想这样做
[UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction)
animations:^{
// animate image array
}
completion:^(BOOL finished){
// [self animationEnded];
}
];
但是我不确定在哪里放置//动画图像数组
答案 0 :(得分:-2)
也许[UIView setAnimationDelegate:self]会帮助你吗?
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context :)];将执行你的animationDidStop :: then。
或者,如果你试图坚持使用块,我认为这将是一系列嵌套动画 - 完整的部分,如
[UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction)
animations:^{
// Show first image
}
completion:^(BOOL finished){
// Hide first image
[UIView animateWithDuration:.7 delay:0 options:(UIViewAnimationOptionAllowUserInteraction) animations:^{
// Show second image
}
completion:^{
// Hide second image
}
}