我该如何在Swift中更改UINavigationBar
的 colored颜色 ?
网上的大多数事情都是这样说的:
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
我翻译成
let titleDict: NSDictionary = ["NSForegroundColorAttributeName": UIColor.whiteColor()]
self.navigationController.navigationBartitleTextAttributes = titleDict
//self is referring to a UIViewController
但它不起作用.我已经改变了背景和按钮的 colored颜色 ,但是文本的 colored颜色 没有改变.有什么 idea 吗?