How do you to set the tint of this yellow button to be gray? I have tried adding an image, but have had no luck.
Here is the screenshot:
Here is my current code:
- (id)initWithStyle:(UITableViewStyle)style {
if (self = [super initWithStyle:style]) {
UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
initWithTitle:NSLocalizedString(@"Settings", @"")
style:UIBarButtonItemStyleDone
target:self
action:@selector(GoToSettings)];
[addButton setImage:[[UIImage imageNamed:@"bg_table.png"] retain]];
self.navigationItem.rightBarButtonItem = addButton;
self.navigationItem.hidesBackButton = TRUE;
self.view.backgroundColor = [UIColor blackColor];
}
return self;
}
self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:0.1f green:0.66f blue:0.26f alpha:0.7];
From iOS 5.0 and on you can use:
[[UINavigationBar appearance] setTintColor:[UIColor yellowColor]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With