我的导航栏上有问题。 UIBarButtonItem
tintColor
是橙色的,但当我目前popover时,barButtonItem
tintColor
更改为lightGray。导航栏色调颜色是whiteColor。 popover后,我需要留下橙色。 有人可以帮我吗?谢谢!iOS 7 popover包含进度条和barbuttonItem色调颜色
EDIT 1
我使可选择barButtonItem和我的UIBarButtonItem的亚类:
-(void)setSelected:(BOOL)selected {
_selected = selected;
if (selected) {
self.tintColor = self.selectedColor;
} else {
self.tintColor = self.defaultColor;
}
}
-(id)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action defaultColor:(UIColor *)defaultColor {
self = [super initWithImage:image style:style target:target action:action];
if (self) {
self.tintColor = defaultColor;
}
return self;
}
-(id)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action defaultColor:(UIColor *)defaultColor {
self = [super initWithTitle:title style:style target:target action:action];
if (self) {
self.tintColor = defaultColor;
}
return self;
}
编辑2
感谢名单沃伦伯顿为答案,解决方法是:
self.navigationController.navigationBar.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
我编辑了我的问题。我需要改变tintColor当我按下bar按钮,但当popover呈现 - 我需要防止颜色改变 –
看到编辑 - 它解释 –
谢谢,这可以帮助我! –