【问题标题】:Changing the button color of a navigation bar更改导航栏的按钮颜色
【发布时间】:2013-07-17 03:55:26
【问题描述】:

iOS 6的导航栏没有图片可以改变按钮颜色吗?

我在其他 stackoverflow 帖子中看到,在 iOS 5 中您需要一张图片。这仍然是真的吗?

【问题讨论】:

标签: ios ios6 uiviewcontroller uinavigationcontroller uinavigationbar


【解决方案1】:

用 tint color 改变颜色。下面将为您提供一个带有红色背景的按钮。

UIBarButtonItem *button = [[UIBarButtonItem alloc] init];
[button setTintColor:[UIColor redColor]];

或者如果使用故事板/xib,则有一个色调下拉菜单。

【讨论】:

  • 非常感谢。我看到网上的其他一些帖子显然很旧。
  • 没问题。请接受。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-28
  • 2017-12-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多