-(void)viewDidLoad
{
[super viewDidLoad];
imgView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"splash_slide_1.png"],[UIImage imageNamed:@"splash_slide_1.png"]
}
我希望图像在 imageview 上反复淡入淡出
采用:
[UiView animateWithDuration:delay:options:animations:completion:]
然后fadeIn,FadeOut在完成时改变图像,再次fadeIn。但是如果你想要动画重叠,那么你应该使用 2 个 UIImageView。
UIImage * toImage = [UIImage imageNamed:@"myname.png"];
[UIView transitionWithView:self.view
duration:5.0f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
self.imageView.image = toImage;
} completion:nil];