Note that there are some explanatory texts on larger screens.

plurals
  1. POUINavigationBar custom background hides title on newly pushed viewcontroller
    text
    copied!<p>I have a navigation controller with a custom navBar with an image background that I setup like this:</p> <pre><code>homeViewController = [[HomeViewController alloc] init]; mainController = [[MainController alloc] initWithRootViewController:homeViewController]; // ### CUSTOM GRADIANT BLUE TOOLBAR UIImageView *customTabView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 1024.0, 44.0)]; [customTabView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"navbar" ofType:@"png"]]]; customTabView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [mainController.navigationBar insertSubview:customTabView atIndex:0]; [customTabView release]; </code></pre> <p>In the homeViewController viewDidLoad I set the title like this:</p> <pre><code>self.title = NSLocalizedString(@"app.title", nil); </code></pre> <p>and it displays perfectly fine. BUT when I push a new controller and set the title inside it the same way, it doesn't show up anymore:</p> <pre><code>Glossary *glossaryController = [[Glossary alloc] init]; [self.navigationController pushViewController: glossaryController animated:YES]; </code></pre> <p>I do not understand the cause of this problem since the title display fine for the root view controller using exactly the same technique and I cannot find anyone with the same issue. Inside glossary viewDidLoad:</p> <pre><code>self.title = NSLocalizedString(@"app.glossary", nil); </code></pre> <p>I think the title is actually "there" but hidden under the custom view but I don't see how that is possible since I inserted that custom view at the bottom (index:0). Unless pushing a new view controller affects this? In which case I would appreciate any input explaining what exactly happens and how I can deal with it.</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload