我正在使用标签栏 Controller ,当我在显示 4 个标签后运行应用程序时,我有 6 个标签,并且有更多选项,但在这里我想显示所有不想在 ios 7 中显示“更多”的标签。代码是:

    UIViewController *viewController1 = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];

    Calendar *viewController2 = [[Calendar alloc] initWithNibName:@"Calendar" bundle:nil];

    nearby *viewController3 = [[nearby alloc] initWithNibName:@"nearby" bundle:nil];
    offer *viewController4 = [[offer alloc] initWithNibName:@"offer" bundle:nil];
    social *viewController5 = [[social alloc] initWithNibName:@"social" bundle:nil];
    contact *viewController6 = [[contact alloc] initWithNibName:@"contact" bundle:nil];



    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController1];
    UINavigationController *navController1 = [[UINavigationController alloc] initWithRootViewController:viewController2];
    UINavigationController *navController2 = [[UINavigationController alloc] initWithRootViewController:viewController3];
    UINavigationController *navController3 = [[UINavigationController alloc] initWithRootViewController:viewController4];



    self.tab = [[UITabBarController alloc] init];

    self.tab.viewControllers = [NSArray arrayWithObjects:navController, navController1,navController2,navController3,viewController5,viewController6, nil];
    [[self.tab tabBar] setBackgroundImage:[UIImage imageNamed:@"tabcrop.png"]];
  self.tab.customizableViewControllers = nil;
    [[[self.tab moreNavigationController] visibleViewController] setTitle:@""];

    [self.tab.tabBar setTranslucent:YES];
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       [UIFont fontWithName:@"AmericanTypewriter" size:10.0f], UITextAttributeFont,
                                                       [UIColor yellowColor], UITextAttributeTextColor,
                                                       [UIColor redColor], UITextAttributeTextShadowColor,
                                                       [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)], UITextAttributeTextShadowOffset,
                                                       nil] forState:UIControlStateSelected];
    self.window.rootViewController = self.tab;

`

最佳答案

根据苹果的文档,这是不可能的:https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/TabBarControllers.html

这就是它所说的:



所以尝试自定义标签栏试试这个:
https://github.com/Marxon13/M13InfiniteTabBar

关于ios - 如何从标签栏 Controller 中删除 "more"选项而不删除 ios 中的标签,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23356910/

10-12 12:42
查看更多