简体   繁体   中英

How can I set the foreground color of the text of the navigation item in iOS

I set the text of the navigation item by doing this:

 viewController.navigationItem.title = @"MyTitle"

How can I set the color of the text? I look for that in apple documentation: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationItem_Class/index.html

But i don't see a method which set the color of the text.

Use a titleView instead of a title string. The titleView is a view and now you are in total charge of how it looks. For example you could use a label with a text color.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM