0

以下是上述问题的代码行。此问题发生在Swift 4.1.

let textAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes
4

1 回答 1

3

我通过替换属性字符串的键解决了这个问题。

这是我更新的代码是:

let textAttributes = [NSForegroundColorAttributeName : UIColor.white]
navigationController?.navigationBar.titleTextAttributes = textAttributes
于 2018-05-14T08:20:50.407 回答