Reputation: 5101
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:
I need to add more tabs to the tab controller. I am doing it at the storyboard as follows:
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:
I need to know what am I doing wrong.
Upvotes: 76
Views: 71085
Reputation: 178
go t0 library and choose tabbar controller then drag and drop after that take another uiviewcontroller and then click on tabbar and control and right click then drag and drop in the uiviewcontroller then you see some options where you have to choose in the relationship segue -> view controller
for more clearance see these images
Upvotes: 0
Reputation: 11
bellow process is follow in Xcode 9.4 for adding new item in tab bar controller. 1)Drag and Drop new Tab Bar Controller into sotrtyboard 2)It will show 2 item which connected with 2 view controller. 3)For adding third item button in tab bar controller i) Add new View Controller. ii) Right click on Tab Bar Controller and Drag into new view controller. iii) one option popup will display inside that popup select "view controllers" options
It will create relationship link and will generate automatic item button in tab bar controller.
Upvotes: 1
Reputation: 179
Restarting Xcode 6.1.1 solved the issue for me while I was working on multiple projects.
Upvotes: 0
Reputation: 7073
I had the same problem until I added a tab bar item from the object library into the new view (settings its attributes on the right hand panel) and THEN ctrl dragged from the tab bar controller to the new view, creating a relationship segue.
If I tried to ctrl drag from the tab controller without first adding a tab item to the new view, it had the behaviour you described.
Upvotes: 7
Reputation: 63
need to add/drag icon (from showing the media library) to the 3rd view controller, so that it can display properly.
Upvotes: 0
Reputation: 41
be sure to check the size of your icon image. the tint of image added is grey by default. If you have a large sized tab bar image, it can look like the whole tab bar is greyed out for some reason. pic does not auto resize.
Upvotes: 4
Reputation: 3908
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
Upvotes: 147