iphone - 导航栏中的按钮颜色 - iPhone

标签 iphone uinavigationbar

如何将此黄色按钮的色调设置为灰色?我尝试过添加图像,但没有成功。

这是屏幕截图:

alt text

这是我当前的代码:

- (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/

相关文章:

ios - 过渡到具有透明背景图像的 UINavigationBar 会导致黑色闪烁

ios - 导航栏后面的搜索栏

ios - 在 Storyboard 中的单个 ViewController 上隐藏状态栏

iphone - iOS FBConnent 登录弹出问题

ios - 如何修复 iPhone 6 上的模糊文字 (+)

ios - 如何为 iPhone 6 Plus 之前的所有 iPhone 设备支持一个 xib?

ios - 导航栏动画。为什么。诡异的

ios - 如何在 Swift 中识别我们来自哪个 View Controller

iphone - "Pushing the same view controller instance more than once is not supported"异常

iphone - 为什么 viewDidUnload 的调用频率低于 viewDidLoad?