我有一个UITabBar有5个项目.我想更改所有项目的未选择颜色.这些项未在UIViewController类中声明(我构建它们并链接Storyboard中的视图).
有这样的代码:[[UITabBar appearance] set***UN***SelectedImageTintColor:[UIColor whiteColor]];?
我想检测的iOS 6特定外观的方法,通过运行respondsToSelector在[UIBarButtonItem appearance].但是,NO无论我指定哪个选择器,它总是为我返回:
// Should show NOPE in iOS 5, YEP in iOS 6. Shows NOPE always
NSLog(@"%@", [[UIBarButtonItem appearance] respondsToSelector:@selector(setBackgroundImage:forState:style:barMetrics:)] ? @"YEP" : @"NOPE");
// Should show YEP in both iOS 5 and iOS 6. Shows NOPE always
NSLog(@"%@", [[UIBarButtonItem appearance] respondsToSelector:@selector(setBackgroundImage:forState:barMetrics:)] ? @"YEP" : @"NOPE");
Run Code Online (Sandbox Code Playgroud)
实际上使用这些方法在他们各自的iOS版本上工作正常,但我似乎无法检测到哪一个可供我使用.那我该怎么做呢?