I have a tab bar controller with five view controllers which is modally presented from the main tab bar controller. Each view controller has a navigation controller with a visible navigation bar. On initial presentation of the tab bar controller, all five view controllers' titles are set properly (they are set using the titleView property of each view controller's navigationItem). However, if you tap any of the other view controllers and then go back to the original one, the titleView disappears and never reappears. It also happens when you select the tab which is currently selected. If this weren't happening I would simply add the titleView back in viewWillAppear:/viewDidAppear:. Doing that fixes the problem for switching between unselected tabs, so the real issue is selecting an already selected tab. This does not happen in the main tab bar. Only in the modally presented one. Suggestions?
Asked
Active
Viewed 685 times
1 Answers
0
I had similar issue. Try to alloc init backBarButtonItem property, like this:
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Go Back" style: UIBarButtonItemStyleBordered target:nil action:nil] autorelease];

Michal Gumny
- 1,770
- 1
- 16
- 24
-
Thanks for the response! Unfortunately, the problem isn't with the left or right bar button items but rather with the titleView of the navigationItem. – Jacob Dec 14 '11 at 20:08