Reputation: 31
I am using tab bar controller and i have 6 tabs when i run app at that time after 4 tab is displayed and there is more option but here i want displaying all tabs not want to display "more" in ios 7. the code is :
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;
`
Upvotes: 3
Views: 1888
Reputation: 3416
According to apple's docs it is not possible: https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/TabBarControllers.html
This is what it says:
If you add more than five items to the viewControllers property, the tab bar controller automatically inserts a special view controller (called the More view controller) to handle the display of the additional items. The More view controller provides a custom interface that lists the additional view controllers in a table, which can expand to accommodate any number of view controllers. The More view controller cannot be customized or selected and does not appear in any of the view controller lists managed by the tab bar controller. It appears automatically when it is needed and is separate from your custom content.
So try custom tab bar try this: https://github.com/Marxon13/M13InfiniteTabBar
Upvotes: 4