我正在尝试完成这样的事情:
我的设置是这样的:
I have a Storyboard Setup with the SlidingViewController as the RootViewController. The Left Panel is acting as the Navigation Menu. From this Menu, I have Segues to different NavigationControllers
我想做的事:
I want to transition between different NavigationControllers without 'loosing' the SidePanel. For an example: A User wants to add a product to the cart, but is not signed in - It should take them to the "Account Creation"-Navigation Controller.
我现在是怎么做的:
[self.slidingViewController setTopViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"accountSetup"]];
这确实有效。它改变了顶部导航 Controller ——但它是瞬间完成的。有没有办法让我动画化(就像它可用于 Segues 一样?)
谢谢!
最佳答案
我会将自定义动画代码添加到 SlidingVC 方法中。您可能想要添加一个 bool 并在运行动画代码之前检查它。
{
CGRect topViewFrame = _topViewController ? _topViewController.view.frame : self.view.bounds;
if (myBOOL) {
//my custom anim code
}
[self removeTopViewSnapshot];
[_topViewController.view removeFromSuperview];
[_topViewController willMoveToParentViewController:nil];
[_topViewController removeFromParentViewController];
_topViewController = theTopViewController;
不要忘记重置你的 bool 值。
关于ios - 使用 ECSlidingViewController 在两个 NavigationController 之间进行转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20484887/