簡體   English   中英

如何在iOS中設置導航項文本的前景色

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM