のUIPickerView
サブクラス内にビューがありUINavigationController
ます。UIAppearance
サブクラスに含まれる多くのビューに適用したいプロキシがありますが、を で操作しUINavigationController
たくありません。UIAppearance
UIPickerView
UIAppearance
サブクラス内のすべてのビューにプロキシを適用し、UINavigationController
特定のオブジェクト内のビューをその影響から保護する方法はありますか?
UIAppearance がない場合、画面は次のようになります。
このコードで:
#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;
}
画面は次のようになります。
UINavigationController に含まれる他の多くのビューにシアンを適用したいかもしれませんが、UIPickerview のサブビューがシアンによって破壊されるのは望ましくありません。