3

I want to hide my Splash_View In Page curl Style, so that it can move to another class.

Default.png

Any Idea or suggestion from experts would be welcome.

Kara
  • 6,115
  • 16
  • 50
  • 57
Afreen Khan
  • 175
  • 1
  • 4
  • 12

3 Answers3

3

Try this code:

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

Splash_Image_View.hidden = YES;
Areeba Khan
  • 264
  • 1
  • 2
  • 9
1

You'll need to make the splash image part of the main view to animate it. In your main view controller, set up an IBOutlet for a UIImageView, I'll call it splashImageView. In the MainWindow.xib file, drag in a UIImageView with your splash image on it and hook it up to the outlet. Then in the viewDidAppear of your main view controller .m file, you'll need to do something like this:

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

This will hide the splash view with a curl animation.

architectpianist
  • 2,562
  • 1
  • 19
  • 27
1

The simplest solution comes to mind is to load the same picture in your first [ViewDidLoad] and then doing something like this:

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

                         }];
Segev
  • 19,035
  • 12
  • 80
  • 152