1

所以我想在我的应用程序安装此导航框架之前,设置一个新的window.rootViewController:现在视图被加载

https://github.com/weissi/FRLayeredNavigationController

http://www.youtube.com/watch?v=k9bFAYtoenw&feature=plcp

,如果你看一下添附图像,我有我的登录屏幕。登录完成后,我会将Segue Modal推入我的“主页”页面,然后在那里,我希望一旦到达我的主页就开始拥有FRLayeredNavigationController。使用故事板时可能吗?据YouTube视频,一个通常会做使用FRLayeredNavigationController:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    { 
     // Override point for customization after application launch. 

     HomeViewController* homeController = [[HomeViewController alloc] init]; 
     FRLayeredNavigationController* lnc = [[FRLayeredNavigationController alloc] initWithRootViewController:homeController]; 

     self.window.rootViewController = lnc; 
    } 



    [self.layeredNavigationController pushViewController:vc inFrontof:self maximumWidth:NO animated:YES]; 

enter image description here

回答

2

我还没有发现那位办法做到这一点使用Segue公司的......但我有办法做到这一点是因为如下:

提供登录成功,你是想应用程序移动到你的下一个部分,再下面是你将如何转型:

- (void)loginSucceeded 
{ 
    UIViewController * vc = (UIViewController*)[self.storyboard instantiateViewControllerWithIdentifier:@"someIdentifier"]; 
    FRLayeredNavigationController * nav = [[FRLayeredNavigationController alloc] initWithRootViewController:vc configuration:^(FRLayeredNavigationItem *item) { 
     item.width = 300; 
     item.nextItemDistance = 90; 
    }]; 
    [self presentViewController:nav animated:YES completion:nil]; 
} 

您需要将Storyboard ID设置为上述方法中指定的值。这可以在查看故事板并选择您设计的ViewController时在“Identity Inspector”选项卡中找到。

此外,您不再需要执行先前创建的segue,因此请删除它。

今后的任何视图控制器要“推”到屏幕上,你只需要调用以下:

UIViewController * vc = (UIViewController*)[self.storyboard instantiateViewControllerWithIdentifier:@"SomeStoryboardIDHere"]; 
[self.layeredNavigationController pushViewController:vc inFrontOf:self maximumWidth:YES animated:NO];