I found a solution that works, although it is really a bit hacked.
The idea is to give a translucent navigation bar an opaque base. Unfortunately, I am not happy with the decision that it is dirty and not encapsulated and presents some potential problems, but I am happy because it did its job.
In my view controller class of the base view (i.e. MyViewController: UIViewController) in the viewDidLoad method, I create a new ivar UIView * _navigationBarBG and give it the same frame as self.navigationController.navigationBar. Then I set the backgroundColor property to [UIColor whiteColor], although I suppose you have achieved even greater hue. [EDIT: If you want to be a purist (color values remaining exactly the same as they come from .psd), you can do _navigationBarBG UIImageView and use your own background there, and the background of the actual UINavigationBar that you set for drawing (or stretch 1px transparent image, if you want to use the typical "change your navigation bar using an image", which is located somewhere on the Internet)]
if(self.navigationController) { _navigationBarBG = [[UIView alloc] initWithFrame: self.navigationController.navigationBar.frame]; _navigationBarBG.backgroundColor = [UIColor whiteColor]; [self.view addSubview:_navigationBarBG]; }
THEN (and this is the trashy part, but I don’t see another way), I add this view as a peep. BUT, whenever you usually make a call to [self.view addSubview: anyView], you need to make sure you call [self.view insertSubview: anyView belowSubview: _navigationBarBG];
if (_navigationBarBG) [self.view insertSubview: anyView belowSubview:_navigationBarBG]; else [self.view addSubview: anyView];
If you forget this, these added views will glide beneath your navigation background and look weird. Therefore, you need to know that this is the source of errors.
WHY DO I DO IT? Again, you may ask ... I want to have a scrollable navigation bar that scrolls out of the way when you scroll down the table view, thereby giving the user more screen space. This is done using the scrollView delegate (scrollViewDidScroll :), as well as viewWillAppear:
// FIRST DEAL WITH SCROLLING NAVIGATION BAR CALayer *layer = self.navigationController.navigationBar.layer; CGFloat contentOffsetY = scrollView.contentOffset.y; CGPoint newPosition; if (contentOffsetY > _scrollViewContentOffsetYThreshold && self.scrollingNavigationBarEnabled) { newPosition = CGPointMake(layer.position.x, 22 - MIN((contentOffsetY - _scrollViewContentOffsetYThreshold), 48.0)); // my nav bar BG image is 48.0 tall layer.position = newPosition; [_navigationBarBG setCenter: newPosition]; // if it nil, nothing happens } else { newPosition = kNavBarDefaultPosition; // ie CGPointMake(160, 22) -- portrait only layer.position = newPosition; [_navigationBarBG setCenter: newPosition]; // if it nil, nothing happens }