How to change the navigation bar height

后端 未结 3 969
小鲜肉
小鲜肉 2021-01-13 08:58

I saw a solution to change the height of navigation bar. But nothing worked for me. Now my application has one view controller connected with a navigation controller. I have

3条回答
  •  梦毁少年i
    2021-01-13 09:41

    Very simple solution to this problem is you can create view from StoryBoard or from Code.

    And add the view to your viewController.

    You have to disable default navigation Bar from you project. You can do it by Storyboard also. Select your navigation bar and change the Status Bar to none:

    And If you want to do via code then in your didFinishLaunching wirte this code:

    UIStoryboard *tStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        RootVC* RootVCObj = [tStoryBoard instantiateViewControllerWithIdentifier:@"RootVC"];
    
        UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:RootVCObj];
        navC.navigationBarHidden = YES;
    

    After this add as many as Buttons to your view

    Main cons of this is that you have to make custom view for all Screens you currently have

提交回复
热议问题