我想使用带有块的 UIView 动画而不是 UIImageview 动画。因为我需要知道动画何时完成,所以我决定将 UIView Animation 与我不熟悉的块一起使用。所以我想要这个:
NSMutableArray *mixedimages = [[NSMutableArray alloc] initWithCapacity:5];
for(int count = 1; count <= 5; count++)
{
NSString *fileName = [NSString stringWithFormat:@"Picture_%d.jpg", count];
UIImage *frame = [UIImage imageNamed:fileName];
[mixedimages addObject:frame];
}
gamePicture.animationImages = mixedimages;
gamePicture.animationDuration = 1;
gamePicture.animationRepeatCount = 10;
[gamePicture startAnimating];
进入这个:
[UIView animateWithDuration:1 animations:^{
//animation code here
} completion:^(BOOL finished)
{
NSLog(@"Animation finished");
}];
但是我不知道填写什么代码会和上面一样,这样我就会有同样的动画。