I have a UIPickerView
in a view inside a subclass of UINavigationController
. I have a UIAppearance
proxy that I want to apply to many views contained in the UINavigationController
subclass, but I don't want the UIAppearance
to operate on the UIPickerView
.
Is there any way to have the UIAppearance
proxy apply to all views inside the UINavigationController
subclass and then protect views inside specific objects from its effect?
Without UIAppearance, the screen looks like this:
With this code:
#import "AppDelegate.h"
@interface AppDelegate()
@property (nonatomic, strong) UINavigationController *nvcMain ;
@end
@implementation AppDelegate
@synthesize window ;
@synthesize nvcMain ;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main_ph" bundle:nil] ;
nvcMain = [sb instantiateInitialViewController] ;
window.rootViewController = nvcMain ;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
id apprNVCView = [UIView appearanceWhenContainedIn:[UINavigationController class], nil] ;
[apprNVCView setBackgroundColor:[UIColor cyanColor] ];
return YES;
}
the screen looks like this:
I don't want the subviews of the UIPickerview to be clobbered by the cyan, although I may want to apply cyan to many other views contained in the UINavigationController.