UINavigation push 于 present到另一个页面详解

如果页面中没有导航栏,可以present到这个A页面,在A页面想要跳转到有个有导航栏的页面就需要添加给B页面添加一个UINavigationController 然后present到B页面,代码如下 

 ChatViewController *cvc = [[ChatViewController alloc]init];

  UINavigationController *navi=[[UINavigationController alloc] initWithRootViewController:cvc];

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

 

还有一种方法是push到该页面把导航栏给隐藏 在A页面将要出来的时候,self.navigationgBar.hidden = YES;

页面跳转之前self.navigationgBar.hidden = NO;push跳转

posted @ 2016-04-14 10:52  秋棠枫眠  阅读(303)  评论(0编辑  收藏  举报