色调颜色无法在导航栏上显示模态

时间:2015-06-24 06:13:39

标签: ios

所以我自定义了我的应用程序的导航栏,如下所示:

enter image description here

基本上,我希望标题和按钮为白色。只要显示任何新视图(a.k.a 推送),它就可以正常工作。但是,当点击 + 按钮进入当前模式时,所呈现的视图没有白色导航按钮:

enter image description here

奇怪的是,如果我将segue类型更改为 show ,按钮将按预期为白色。

我在 AppDelegate.swift 中全局自定义导航栏,代码为:

UINavigationBar.appearance().tintColor = UIColor.whiteColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]

有任何线索吗?非常感谢!

修改

仍未通过添加这些行修复

UIBarButtonItem.appearance().tintColor = UIColor.whiteColor()
self.window?.tintAdjustmentMode = UIViewTintAdjustmentMode.Normal

解决方案:

好的,这是一个愚蠢的错误。我还可以通过

自定义按钮颜色
UIButton.appearance().tintColor = BRAND_COLOR

如果我注释掉这一行,它就可以了。现在我想知道如何以正确的方式自定义UIButton ......

0 个答案:

没有答案