I have a custom image header ABOVE the uinavigationbar. I do this with this code:
self.navController.view.frame = CGRectMake(0.0, 0.0, 320.0, 480.0);
self.navController.navigationBar.frame = CGRectMake(0.0, 73.0, 320.0, 44.0);
UIView *checkNav = [self.navController.view viewWithTag:9999];
if (checkNav == nil) {
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"header-logo.jpg"]];
imgView.tag = 9999;
[imgView setFrame:CGRectMake(0.0, 23.0, 320.0, 50.0)];
[self.navController.view addSubview:imgView];
}
This works great. But, when the app goes inactive (hit the main iphone home button) and then you go back into the app, the uinavigationbar shifts up to the default place at the top of the screen and is hidden behind my custom header image.
I’ve tried throwing code into applicationDidBecomeActive, but it doesn’t help. Any help would be greatly appreciated.
Thanks!
You do get warned about this in the docs:
Having said that, you should be able to get the effect by repeating your above code in applicationDidBecomeActive or applicationWillEnterForeground, assuming you have a pointer to the navigation controller from there. You may find that hiding and re-showing the navigation bar is required (bit of a hack, but it can help – I had a similar problem with hiding / showing the status bar and the navigation bar not going to its correct place)