Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new tabs to a tab bar controller

I am creating a tab bar iOS app. The tab bar view controller has two tabs, each of them connected to a view controller.

This how it looks:

enter image description here

I need to add more tabs to the tab controller. I am doing it at the storyboard as follows:

  1. I add a new view controller.
  2. I control-drag from the tab bar controller to the new created view controller.
  3. A window opens and I select Relationship Segue-View Controller.
  4. The segue from the tab bar controller to the new view controller is created.

I think that is the way to do it, but after that the tab bar controller doesn't show any tab icons, the tab bar becomes grey.

Like this:

enter image description here

I need to know what am I doing wrong.

like image 798
mvasco Avatar asked Apr 28 '14 04:04

mvasco


People also ask

How do I make a tab bar controller?

We open up our Main. storyboard and go ahead and delete the pregenerated view controller. Dragging a "Tab Bar Controller" from the Object Library into the storyboard automatically creates two view controllers that are already in the tab bar controller's array of view controllers.

What is tab bar controller?

A Tab Bar Controller is a container view controller that manages an array of view controllers in a radio-style selection interface so that the user can interact with the interface to determine the view controller to display. It is the instance of UITabBarController, which inherits UIViewController.


1 Answers

First drag A TabBarController from Object Library you see that only two tabs with thier VC there.

to add more Tab Item in TabBarVC drag VC from Object Library

Then Control drag from TabBarVC to Newly VC then Segue relation pop ups

Select last one Relationship Segue -> View Controllers

Here is the Screen

like image 77
Pandey_Laxman Avatar answered Sep 23 '22 10:09

Pandey_Laxman