Question

In a new tabbed app application when two more views are added, views which are created by default has a black bar on bottom and the two views that are manually created doesn't have that black bar ?

How to enable that black bar ?

Was it helpful?

Solution

You need to connect your two other scenes to the tab bar controller. Hold the control key down, and drag from Tab Bar View Controller to the other View Controller. When it asks what type of a segue you want to create, choose "view controllers" under the "Relationship" segue section.

enter image description here

If you are using NIBs, drag a view controller object from the object library into the tab bar controller. Once it's there, select the new view controller in the view controller explorer and configure the Custom Class in the Identity Inspector.

enter image description here

... and the name of the nib in the Attributes Inspector.

enter image description here

OTHER TIPS

In your app delegate you should see code like this:

UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, viewController2];

Modify it to include your third and fourth view controllers. Otherwise, how would your tab controller know your new view controllers exist!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top