【问题标题】:Unable to set a UIBarbutton back to the default tint color无法将 UIBarbutton 设置回默认色调
【发布时间】:2012-07-12 19:52:43
【问题描述】:

如果我更改 UIBarbutton 的色调,如何将其重置为默认色调。

我在这里为按钮设置了自定义色调...

examCancelButton.style = UIBarButtonSystemItemCancel;
examCancelButton.tintColor = myRedButtonTint;

然后我需要将它设置回它的默认样式和色调。所以我认为只需将样式设置为 UIBarButtonItemStyleDone 就可以做到这一点......

examCancelButton.style = UIBarButtonItemStyleDone;

但颜色仍然是红色。我可以自己将其设置为漂亮的蓝色,但我想获得 UIBarButtonItemStyleDone 按钮的默认颜色。这可能吗?

谢谢,约翰

【问题讨论】:

  • 您是否尝试将tintColor 设置为nil

标签: iphone xcode ipad uibarbuttonitemstyle


【解决方案1】:

examCancelButton.tintColor = nil;

【讨论】:

  • 也适用于 UIButtons。 [dataProtectionButton setTitleColor:nil forState:UIControlStateNormal];
猜你喜欢
  • 2015-10-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多