如何在iPhone中关闭Pagecurl风格的SplashView?

时间:2013-03-12 12:10:39

标签: ios iphone xcode animation page-curl

我想隐藏我的Splash_View In Page curl Style,以便它可以移动到另一个类。

为Default.png

欢迎专家提出任何想法或建议。

3 个答案:

答案 0 :(得分:3)

试试这段代码:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.window cache:YES];
[UIView commitAnimations];

Splash_Image_View.hidden = YES;

答案 1 :(得分:1)

您需要将启动图像作为主视图的一部分来为其设置动画。在主视图控制器中,为UIImageView设置IBOutlet,我将其命名为splashImageView。在MainWindow.xib文件中,拖动UIImageView并在其上放置启动图像并将其连接到插座。然后在主视图控制器.m文件的viewDidAppear中,您需要执行以下操作:

[UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionTransitionCurlUp animations:^{
   splashImageView.hidden = YES;
} completion:NULL];

这将使用卷曲动画隐藏启动视图。

答案 2 :(得分:1)

最简单的解决方案是在第一个[ViewDidLoad]中加载相同的图片,然后执行以下操作:

    [UIView transitionWithView:self.view duration:0.4
                         delay:0.0
                         options:UIViewAnimationOptionTransitionCurlUp
                         animations:^{
                         //hide splash here
                         }
                         completion:^(BOOL finished){ 

                         }];