Trying out iOS 7 did:
[[UINavigationBar appearance] setTranslucent:NO];
Got crash and error:
*** Terminating app due to
I solved it with my own category so that I can still use UIAppearance in something like the normal manner.
@interface UINavigationBar (MMTranlucenceUIAppearance)
@property(nonatomic,assign,getter=isMMTranslucent) NSInteger LYTranslucent NS_AVAILABLE_IOS(3_0) UI_APPEARANCE_SELECTOR; // Default is NO on iOS 6 and earlier. Always YES if barStyle is set to UIBarStyleBlackTranslucent
@end
@implementation UINavigationBar (MMTranlucenceUIAppearance)
// it appears that UIAppearance fails with BOOL
-(NSInteger)isMMTranslucent
{
return self.translucent ? 0 : 1;
}
-(void)setMMTranslucent:(NSInteger)translucent
{
self.translucent = (translucent == 0) ? NO : YES;
}
@end