Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Titles not appearing on the ViewControllers navigation bar

I am currently using the storyboard interface builder to design my GUI.

My structure looks like following in storyboard

-> Navigation Controller -> Tab Bar Controller -> SomeViewController
                                               -> AnotherViewController

Navigation Bar and Tab Bar appears fine in the ViewControllers, and the titles are set and visible in the editor, but in simulation the titles disappear.

How do i resolve this problem?

FYI: Navigation Controller and Tab Bar Controller are not bound to any Custom Class.

like image 833
JavaCake Avatar asked May 10 '12 21:05

JavaCake


People also ask

How do I add a button to the navigation bar on storyboard?

Drop a button on the right-hand side of the navigation bar, then switch to the assistant editor so we can connect it to some code. Ctrl-drag from your new bar button item into your source code, and when you release your mouse button change Connection from “Outlet” to “Action”.

How do I add a tab bar to my navigation controller?

To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.


1 Answers

self.navigationController.navigationBar.topItem.title = @"YourTitle";

Simply put that in viewDidAppear in your ViewControllers.

like image 113
Martol1ni Avatar answered Nov 15 '22 18:11

Martol1ni