How to set the Navigation Bar Color of the Tab Bar Configure Menu

后端 未结 8 493
离开以前
离开以前 2021-02-03 21:39

removed dead ImageShack link

As you can see the view I need to change is the provided view to customize the tabbar order. I want to change the color of the navi

相关标签:
8条回答
  • 2021-02-03 21:49

    Use int AppDelegate

    tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor];
    
    0 讨论(0)
  • 2021-02-03 21:49

    Its Surely gonna work! :-)

    self.navigationController.navigationBar.tintColor  = [UIColor blackColor];
    
    0 讨论(0)
  • 2021-02-03 21:51

    I think what you are looking for is this (to do when you create your navigation controller, typically in your app delegate):

    UINavigationController *navigationController;
    ...
    navigationController.navigationBar.tintColor = [UIColor blackColor];
    
    0 讨论(0)
  • 2021-02-03 21:51

    There is an easy way to change all the navigation bar styles instead of changing each one separately.

    [[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
    

    Just set this code in one of your initial views. With this, your more navigation controller and the configuration navigation controller (that appears after clicking "Edit" in more navigation controller) get a different style.

    Like this you can change its color to a different one or change the background image.

    Hope this helps.

    0 讨论(0)
  • 2021-02-03 21:51

    I was able to change the color of the Configure NavBar like this:

    1. Create a new class that inherits from UITabBarController.
    2. Implement this method:

      -(void)beginCustomizingTabBar:(id)sender
      {
          [super beginCustomizingTabBar:sender];
      
          // Get the new view inserted by the method called above
          id modalViewCtrl = [[[self view] subviews] objectAtIndex:1];
      
          if([modalViewCtrl isKindOfClass:NSClassFromString(@"UITabBarCustomizeView")] == YES)
          {
              UINavigationBar* navBar = [[modalViewCtrl subviews] objectAtIndex:0];
      
              [navBar setBarStyle:UIBarStyleBlackTranslucent];
              [navBar setTranslucent:YES];
          }
      }
      
    0 讨论(0)
  • 2021-02-03 21:52

    Building off of the answer given by user486217, this may be even more defensively-coded:

    id modalViewCtrl = [controller.view.subviews objectAtIndex:1];  
    if([modalViewCtrl isKindOfClass:NSClassFromStrin(@"UITabBarCustomizeView")] == YES) {
        id navigationBar = [[modalViewCtrl subviews] objectAtIndex:0];
        if ([navigationBar isKindOfClass:[UINavigationBar class]]) {
            ((UINavigationBar*)navigationBar).tintColor = [UIColor redColor];
        }
    }}
    
    0 讨论(0)
提交回复
热议问题