简体   繁体   中英

Show UINavigationController with UIViewController animation

I have a storyboard with few UINavigationControllers and UIViewControllers .

主板

When I performSegueWithIdentifier(..) from the second to third window default animation is right to left slide. But when I performSegueWithIdentifier(..) from the third window to UINavigationController the animation is from bottom to top slide. How to set UIViewController -> UINavigationController animation to one like UIViewController -> UIViewController ?

YOURVC *vc = [[YOURVC alloc]init];
UINavigationController *VCNavigation = [[UINavigationController alloc]initWithRootViewController:vc];

And when you are calling from 1 to 3 or any call

[self.navigationController pushViewController:vc animated:YES];

or from 2 to 1 also you can call like this and instead you can call

[self.navigationController popViewControllerAnimated:YES];

or to root view controller use

[self.navigationController popToRootViewControllerAnimated:YES];

or to a particular vc

[self.navigationController popToViewController:yourvc Animated:YES];

Then if you want to show navigation keep it, or if you want to hide you can hide it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM