Reputation: 2687
I notice that in iOS5 we can custom UIKit control by UIAppearance
and I start to use it.
I'd like to use appearanceWhenContainedIn:
to custom the UINavigationBar
's tintColor
in different class, for example:
[[UINavigationBar appearanceWhenContainedIn:[A class], nil] setTintColor:[UIColor greenColor]];
[[UINavigationBar appearanceWhenContainedIn:[B class], nil] setTintColor:[UIColor redColor]];
However, it totally doesn't work. And I tried to add property in Class A/B like:
@property (strong, nonatomic) UIColor *tintColor UI_APPEARANCE_SELECTOR;
It seems workless too.
Any tips? Thanks.
Upvotes: 3
Views: 4331