[英]How to change Background and Foreground Color for Navigation Item title in iOS Swift 2.0?
[英]How can I set the foreground color of the text of the navigation item in iOS
我通過這樣做來設置導航項的文本:
viewController.navigationItem.title = @"MyTitle"
如何設置文本的顏色? 我在蘋果文檔中尋找: https : //developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationItem_Class/index.html
但我沒有看到設置文本顏色的方法。
使用titleView
而不是title
字符串。 titleView
是一個視圖,現在您完全負責它的外觀。 例如,您可以使用帶有文本顏色的標簽。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.