iOS 7 : Disable UINavigationBar Translucency For Entire App
if you set the translucence of the first navigation bar in the stack to false
[self.navigationController.navigationBar setTranslucent:NO]
, it will reflect in all the following NavigationViewController that are pushed to that stack.
I think you are right about no appearance proxy being available for this property. Are you using UINavigationControllers or UINavigationBar objects? If you are using UINavigationBars you could subclass it and create a non-translucent nav bar.
Header file:
#import <UIKit/UIKit.h>
@interface ABCNonTranslucentNavBar : UINavigationBar
@end
Implementation file:
#import "ABCNonTranslucentNavBar.h"
@implementation ABCNonTranslucentNavBar
- (void)drawRect:(CGRect)rect
{
[self setTranslucent:NO];
}
Then just replace the UINavigationBars with your subclass. You could also do something similar with a subclassed UINavigationController.
Here is a Swift solution if you want to apply this Styling to the whole app.
in the AppDelegate
class add this to the didFinishLaunchingWithOptions
:
For Swift 2:
UINavigationBar.appearance().translucent = false
For Swift 3+:
UINavigationBar.appearance().isTranslucent = false
It seems very simple with this code in appDelegate
didFinishLaunchingWithOptions
(works fine with iOS 8 and above versions)
[[UINavigationBar appearance] setTranslucent:NO];