use*_*124 4 objective-c uinavigationbar ios
我正在iOS 11中使用新的放大导航栏标题.但我似乎无法更改textColor.
我试过做:
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
Run Code Online (Sandbox Code Playgroud)
这没有做任何事情.有任何想法吗?
Dav*_*ght 20
self.navigationController.navigationBar.largeTitleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
Run Code Online (Sandbox Code Playgroud)
小智 8
我认为它仍然是Xcode 9 beta 6中的一个错误.
我找到了不同的"解决方案":
if #available(iOS 11.0, *) {
UINavigationBar.appearance().largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.blue]
}
if #available(iOS 11.0, *) {
self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.blue, NSAttributedStringKey.font: UIFont.systemFont(ofSize: 31, weight: UIFont.Weight.bold) ]
}
希望它能帮到你.
问候!
| 归档时间: |
|
| 查看次数: |
8123 次 |
| 最近记录: |