[英]Navigation Bar Title background is white in iOS11
檢查是否已正確設置標題文本屬性。 您可以從Storyboard或Programatically設置標題文本屬性。 選擇Storyboard -> NavigationBar -> Go to attribute inspector -> Title Text Attributes
或者在ViewController中嘗試手動設置它
斯威夫特4:
self.navigationController?.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 17, weight: .bold)
]
斯威夫特3:
self.navigationController?.navigationBar.titleTextAttributes = [
NSForegroundColorAttributeName: UIColor.white,
NSFontAttributeName: UIFont.systemFont(ofSize: 17, weight: .bold)
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.