ios - 使用 ECSlidingViewController 在两个 NavigationController 之间进行转换

标签 ios objective-c ios7 uinavigationcontroller ecslidingviewcontroller

我正在尝试完成这样的事情:

我的设置是这样的:

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 NavigationControllersenter image description here

我想做的事:

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/

相关文章:

objective-c - UIToolbar 在 iOS 7 中不是半透明的

ios - UITableViewCell 动画破坏 UITableView 触摸检测和滚动

xcode/iOS : Autoresize to fill a view - explicit frame size is essential?

ios - 如何从 Appdelegate 显示 UIAlertController

ios - AddSubView 在 UIScrollView 中不起作用

objective-c - Objective-C : How to check for unread messages (number to be displayed as badge)

objective-c - 解析pdf文件并转换

iphone - 使用 APP Store 配置文件导出 iPhone 应用程序时出现 "Symbols Tool failed"错误

ios - 无法保存到 iOS 7.0.2 上的 NSUserDefaults

iphone - Xcode:无法在设备上启动应用程序(ExperitestServer:级别设置为:(3))