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;
}
From iOS 5.0 and on you can use:
It is not possible without your custom image.
when you set your image of the button in navigation bar, you may want to set UIImageRenderingModeAlwaysOriginal for it:
here is the reference.
Actually it's possible without using image for buttons.