Can anyone tell me about how 开发者_如何学Goto implement a navigation controller in a UIView subclass? I am creating four sub-classes, and I do not want the navigation control in first class, but I need to place it in the second, third and fourth subclass. How can I do that?
Can anybody help me? How do I implement it?
If you dnt want navigation control in first class then you can hide the navigationBar by self.navController.navigationBarHidden = YES; and this has to be in the next class self.navController.navigationBarHidden = NO;
When you call 2nd, 3rd and 4th view from 1st one (which does not have navigation bar) then call it as below:
RootViewController * rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
[self.window addSubview:navigationController.view];
精彩评论