UIView animation when pressing UINavigationController

following situation. I have an application that uses the UINavigationController for navigation.

To push a special navigation controller, I need custom animation, reduction. What I'm still looking good, the only problem is that the "old" Viewcontroller disappears before the animation starts, so the new view manager no longer sees "nothing" instead of viewing the old monitor in the background.

For a better view, I created a simple sample application: download

enter image description hereenter image description hereenter image description here

Does anyone know how to animate the new view manager (image3), which the old view controller (image1) remains in the background during the animation (image 2)?

/* THIS CANNOT BE CHANGED */ AnimatedViewController *animatedViewController = [[AnimatedViewController alloc] initWithNibName:@"AnimatedViewController" bundle:nil]; /* THIS CAN BE CHANGED */ animatedViewController.view.transform = CGAffineTransformMakeScale(0.01, 0.01); [UIView beginAnimations:@"animationExpand" context:NULL]; [UIView setAnimationDuration:0.6f]; animatedViewController.view.transform=CGAffineTransformMakeScale(1, 1); [UIView setAnimationDelegate:self]; [UIView commitAnimations]; /* THIS CANNOT BE CHANGED */ [self.navigationController pushViewController:animatedViewController animated:NO]; 

Additional information: my application is not so simple. I use a three-dimensional structure for my application, but clicking and creating view controllers is just what the three20s do. I can connect only part ( THIS CAN BE CHANGED in my code). I cannot change the code before and after (except for a lot of research).

+4
source share
2 answers

I quickly whipped it. The idea is to call pushViewController after the scale animation completes.

 -(IBAction)animateButtonClicked:(id)sender { animatedViewController = [[AnimatedViewController alloc] initWithNibName:@"AnimatedViewController" bundle:nil]; animatedViewController.view.transform = CGAffineTransformMakeScale(0.01, 0.01); [UIView animateWithDuration:0.6 animations:^{ [self.view addSubview:animatedViewController.view]; animatedViewController.view.transform=CGAffineTransformMakeScale(1, 1); } completion:^(BOOL finished){ [animatedViewController.view removeFromSuperview]; [self.navigationController pushViewController:animatedViewController animated:NO]; }]; } 
+9
source

Well, one way to do this (a little ugly) is to make an animation, and after the animation is done, do a pushViewController. When you make an animation, you need to animate the way the presentation control screen on the screen will look. Since the animation ends with a new view, when a new view appears on the screen, nothing should change because it is the same as just an animated view.

0
source

All Articles