开发者

How to used navigation controller and tab bar controller in appdelegate file

开发者 https://www.devze.com 2023-02-23 04:48 出处:网络
I am facing issue of displaying navigation controller开发者_高级运维 and tab bar controller together either one is displayed depending on the position of adding subview in applicationlaunch method.

I am facing issue of displaying navigation controller开发者_高级运维 and tab bar controller together either one is displayed depending on the position of adding subview in applicationlaunch method.

   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:     (NSDictionary *)launchOptions {    

// Override point for customization after application launch.
   navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
// Add the view controller's view to the window and display.
[self.window addSubview:navigationController.view];
[self.window addSubview:tabBarController.view];

[self.window makeKeyAndVisible];

return YES;
 }


Yes only one can be display at one time. You can set navigation controller in tabs of tabBarController then you can see both at same time.

How to used navigation controller and tab bar controller in appdelegate file

look at item 1 now its viewController change it to navigation controller.


You can add one of controller either navigationController or TabbarController at a time. If you add Tabbar controller and in that controller you add Navigation controller then you can see both.

0

精彩评论

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

关注公众号