Xcode: How to add new tab screen in IOS5 storyboard?
20,910
Solution 1
You first drop in a new ViewController, and then you Ctrl-drag from the Tab Bar Controller to that new controller.
This brings up a popup where you can select "Add Relationship Segue". This connects it as a third tab.
Solution 2
This can be done programmatically:
// Tab Controller
UITabBarController *tabBarController = [[UITabBarController alloc]init];
// Views to be accessed
UIViewController *controllerOne = [[UIViewController alloc]init];
UIViewController *controllerTwo = [[UIViewController alloc]init];
UIViewController *controllerThree = [[UIViewController alloc]init];
// Store UIViewControllers in array
NSArray* screenControllers = [NSArray arrayWithObjects:controllerOne, controllerTwo, controllerThree, nil];
// Add Views to Controller
tabBarController.viewControllers = screenControllers;
Or using InterfaceBuilder:
-
Adding 'Tab Bar Items' to the hierarchy of views in the left-hand panel
Or using Storyboard:
iOS Storyboards (Scroll down/Search for 'Just Add It To My Tab')
Author by
001
Only questions with complete answers are accepted as solutions.
Updated on July 09, 2022Comments
-
001 almost 2 years
I have this.. How do I add another tab screen using iOS5 storyboard, so that "Account" can have 3 screens.
Account ---> Account Listing ---> Account Details
-
Tim about 12 yearsI recommend you use the programmatic approach. There are other programmatic ways to do it, I would definitely recommend any of them over using InterfaceBuilder for this task. Do some research into which approach you prefer.
-
001 about 12 yearshow do you do it in iOS5 story board?
-
zevij almost 8 yearsTo add to the above answer - when you add it in Storyboard, you probably want to add an image via storyboard (even as a placeholder). If you do not add an image, the bottom bar may turn 'grey' and may hide the other tabs images when viewed in Storyboard...