本文介绍了自动淡入 xcode 中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我可以自动淡出图像.我如何设法使图像自动淡入淡出.

Hello I am able to fade an image out automatically. How would I manage to fade the image IN automatically.

这是我的代码.

.h

@property (assign) IBOutlet UIImageView *cbizFadeImage;

.m

- (void)viewDidLoad {
//Fade Image Out
CGRect aboutNicheImageFrame = cbizFadeImage.frame;
aboutNicheImageFrame.origin.y = self.view.bounds.size.height;


// iOS4+
[UIView animateWithDuration:0.5
                      delay:2.0
                    options: UIViewAnimationCurveEaseOut
                 animations:^{
                     cbizFadeImage.alpha = 0;

                 }
                 completion:^(BOOL finished){
                     NSLog(@"Done!");
                 }];
}

好的,我可以通过将 CurveEaseOut 更改为 CurveEaseIn 来淡入图像.但是现在我想淡出图像.所以图像会先缓入然后缓出.我会使用 if 语句吗?

Ok I was able to fade an image in by changing the CurveEaseOut to CurveEaseIn. However now I would like to fade the image out. So the image would first ease in then It would then ease out. Would I use an if statement?

推荐答案

我能够使用 UIViewAnimationCurveEaseInOut.

I was able to use the UIViewAnimationCurveEaseInOut.

这篇关于自动淡入 xcode 中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 09:53