iOS tabbar和NavigationController被放大了

2025-05-05 04:18:00
推荐回答(1个)
回答(1):

  第一种:最简单的是从NavigationController下手,先用TabBarController建立XIB文件,在XIB上拉出相应的Tabbar。这时如果去建立导航,只需要在上一页和下一页之间建立相应的对应关系。而如何建立对应关系呢,请看下面的代码:
  EDUThreeViewController *th = [[EDUThreeViewController alloc] initWithNibName:@"EDUThreeViewController" bundle:nil];
  UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:th];
  [self presentViewController:n animated:YES completion:nil];
  但我现在了解到这种仅支持弹出下一级视图。
  第二种:也是先建立TabBarController的XIB,然后在TabBar上拖入NavigationController,(这里可以根据自己的需要的拖入NavigationControlle或TabBarItem,拖入NavigationController的页面就自动有NavigationBar了)。