1

简单的问题...我的应用程序以带有 UIViewController 的 UINavigationController 开始(当然),但是当按下按钮时,我希望呈现另一个 UINavigationController。

我会这样做:

[self.navigationController presentViewController:AnotherNavigationController animated:YES completion:nil];

或者:

[self presentViewController:AnotherNavigationController animated:YES completion:nil];

两种方式都有效......但我不确定哪一个是正确的......而且,一旦出现导航控制器,我似乎无法让 BarButtonItem 出现

PS。导航控制器有一个标签栏控制器,里面有两个标签视图

先谢谢了!

4

2 回答 2

0

尝试这个:

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

改用 push segue。

于 2013-07-31T04:21:21.990 回答
0

试试这个代码:

登录成功后

UIStoryboard  *Story_TabController = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]
 UIViewController *class1 = [Story_TabController instantiateViewControllerWithIdentifier:@"Feed_ViewController"];

   UIViewController *class = [Story_TabController instantiateViewControllerWithIdentifier:@"FindFriends_ViewController"];


   UINavigationController *nav_profile=[[UINavigationController alloc]initWithRootViewController:class1];
   UINavigationController *nav_post=[[UINavigationController alloc]initWithRootViewController:class2];

    Tab_controller.viewControllers=[NSArray arrayWithObjects:nav_profile,nav_post, nil];

    Tab_controller.selectedIndex=0;
    [self.navigationController pushViewController:Tab_controller animated:YES];
于 2013-07-31T05:05:38.773 回答