iphone - 无法将 UIBarbutton 设置回默认色调

标签 iphone xcode ipad uibarbuttonitemstyle

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

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

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

然后我需要将其设置回默认样式和色调。所以我认为只需将样式设置为 UIBarButtonItemStyleDone 就可以达到这样的效果...

examCancelButton.style = UIBarButtonItemStyleDone;

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

谢谢约翰

最佳答案

examCancelButton.tintColor = nil;

关于iphone - 无法将 UIBarbutton 设置回默认色调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11459574/

相关文章:

ipad - iPad3 上的 Retina 显示屏显示模糊文本

ios - Cocos2D 游戏在旧 Ipad 中崩溃

iphone - 高效使用 NSData

ios - 如何在文本到语音合成过程中停止语音?

ios - 没有 Storyboard的 SpriteKit 示例

iphone - 如何最好地与客户分享 iOS 应用程序的进度

iphone - 带虚线的 UIView

iphone - Ntimer 计数错误

xcode - 为什么我的 xcode 项目文件中有恢复的引用?

iphone - 如何在 xcode 4x 中将代码转换为静态库