我有一个 Storyboard,其中包含一些 UINavigationControllers
和 UIViewControllers
。
当我从第二个窗口到第三个窗口performSegueWithIdentifier(..)
时,默认动画是从右向左滑动。但是当我 performSegueWithIdentifier(..)
从第三个窗口到 UINavigationController
时,动画是从底部到顶部滑动的。如何将 UIViewController
-> UINavigationController
动画设置为 UIViewController
-> UIViewController
?
最佳答案
YOURVC *vc = [[YOURVC alloc]init];
UINavigationController *VCNavigation = [[UINavigationController alloc]initWithRootViewController:vc];
当您调用 1 至 3 或任何电话时
[self.navigationController pushViewController:vc animated:YES];
或者从 2 到 1,你也可以这样调用,而你可以调用
[self.navigationController popViewControllerAnimated:YES];
或者到 Root View Controller 使用
[self.navigationController popToRootViewControllerAnimated:YES];
或特定的 vc
[self.navigationController popToViewController:yourvc Animated:YES];
然后,如果您想显示导航,请保留它,或者如果您想隐藏,则可以隐藏它。
关于ios - 使用 UIViewController 动画显示 UINavigationController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37478615/