开发者

How to implement a navigation controller in a subclass?

开发者 https://www.devze.com 2023-04-06 00:50 出处:网络
Can anyone tell me about how 开发者_如何学Goto implement a navigation controller in a UIView subclass?

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号