在iOS7以后就不要用Appearance proxy来设置UIView的tintColor,否则会影响其它的tintColor.
最开始我不知道,就用这方法来设置了UITextView的tintColor
[[UITextView appearance] setTintColor:[UIColor blueColor]];
结果在设置UIBarButtonItem的tintColor的时候就没有效果
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backAction)];
backItem.tintColor = [UIColor redColor];
self.navigationItem.leftBarButtonItem = backItem;
原因在UIAppearance.h中
Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h.
This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.
所有不要用Appearance proxy来设置UIView的tintColor。