如何将此黄色按钮的色调设置为灰色?我尝试过添加图像,但没有成功。
这是屏幕截图:
这是我当前的代码:
- (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];
关于iphone - 导航栏中的按钮颜色 - iPhone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1340639/