我在分欄控制器上加了4個視圖控制器,只能在根視圖控制器上加導航控制器,分欄控制器上的每個視圖控制器都加上導航控制器,怎麼做。
每一個viewController都得有一個UINavigationController 就行了,類似我下面的寫法就行了
HomePageVC * HomeVC = [[HomePageVC alloc] init];
UINavigationController * HomeNav = [[UINavigationController alloc] initWithRootViewController:HomeVC navigationBarBackgroundColor:backGroudColor];
ChatSessionVC *msgVC = [[ChatSessionVC alloc] init];
UINavigationController *msgNav = [[UINavigationController alloc]initWithRootViewController:msgVC navigationBarBackgroundColor:backGroudColor];
FindHomeVC * FindVC = [[FindHomeVC alloc] init];
UINavigationController * FindNav = [[UINavigationController alloc] initWithRootViewController:FindVC navigationBarBackgroundColor:backGroudColor];
MineVC * UserVC = [[MineVC alloc] init];
UINavigationController * UserNav = [[UINavigationController alloc] initWithRootViewController:UserVC navigationBarBackgroundColor:backGroudColor];
[UserNav setNavigationBarHidden:YES];
NSArray *tabArray = @[HomeNav,msgNav,FindNav,UserNav];