UIImageView *image = [[UIImageView alloc] initWithFrame:self.view.bounds];
image.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"BluePin.png"],
[UIImage imageNamed:@"GreenPin.png"],
[UIImage imageNamed:@"RedPin.png"],
[UIImage imageNamed:@"YellowPin.png"],
nil];
image.animationRepeatCount = 0;
image.animationDuration = 1.0;
[image startAnimating];
[image setFrame: CGRectMake(point.x-(image.bounds.size.width/2), point.y- (image.bounds.size.width/2), image.bounds.size.width, image.bounds.size.height)];
[self.view addSubview: image];
[UIView animateWithDuration:2.0 delay:1.0 options:UIViewAnimationOptionCurveLinear animations:^{
[image setAlpha:0.0];
} completion:^(BOOL finished) {
[image removeFromSuperview];
}];
图像出来的太大了,它们需要保持原始大小基本上会在用户触摸的地方创建图像动画,并在 x 秒后消失