Tag: 淡出

iOS SDWebImage淡入新图像

我一直在我的iPhone应用程序上使用SDWebImage来处理所有的图像加载。 我正在使用一个占位符图像,并且在加载后我想淡入或淡入新图像。 我正在使用成功块来设置图像,它工作的很好。 不pipe我尝试什么,图像都不会褪色。 我已经尝试将animation代码发送回主线程,但是这也没有帮助。 它只是立即加载…没有animation。 这是我的代码。 有什么想法吗? // load placeholder image NSURL *url = … _imageView = [[UIImageView alloc] init]; [_imageView setImage:[UIImage imageNamed:@"loading.jpg"]]; // request image SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager downloadWithURL:url delegate:self options:0 success:^(UIImage *image) { [UIView transitionWithView:_imageView duration:3.0 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ [_imageView setImage:image]; } completion:NULL]; } failure:nil];

如何解雇淡出animation的模态VC?

我在我的演示文稿中使用下面的代码来淡入子模态VC,并且这工作正常: self.infoViewController.view.alpha = 0.0; [self.navigationController presentModalViewController:self.infoViewController animated:NO]; [UIView animateWithDuration:0.5 animations:^{self.infoViewController.view.alpha = 1.0;}]; 但是我不能让它淡出,我已经尝试了一些东西,这是最新的,我试过,这是行不通的: – (IBAction)dismissAction:(id)sender { if ([[self parentViewController] respondsToSelector:@selector(dismissModalViewControllerAnimated:)]) { [[self parentViewController] dismissModalViewControllerAnimated:YES]; self.parentViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; self.parentViewController.view.alpha = 0.0; [UIView animateWithDuration:0.5 animations:^{self.parentViewController.view.alpha = 1.0;}]; } else { [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; self.presentedViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; self.presentedViewController.view.alpha = 0.0; [UIView animateWithDuration:0.5 animations:^{ self.presentedViewController.view.alpha = 1.0;}]; } […]

如何在IOS中应用部分淡入?

我有2张图片。 一个在另一个的后面。 我想淡出从左上angular开始的顶部图像。 我怎样才能做到这一点? 我应该使用渐变面具吗?