Reputation: 11175
I have a support feature in my app that allows users to email for support regarding the app via email. The issue is that while the rest of my app have white navigation bar text, the text in the navigation bar within the email view controller seems to be stuck set to black.
I have this code in the a tableview view controller that segues to a different view controller and on that view controller is a button which launches the email view controller:
override func viewWillAppear(animated: Bool) {
var attributes = [NSForegroundColorAttributeName: UIColor.whiteColor(),NSFontAttributeName: UIFont(name: "Avenir", size: 24)]
self.navigationController?.navigationBar.titleTextAttributes = attributes
}
The view controller that is segued to from the table view has the correct text colour, however the email view controller is still black.
I have tried doing:
mc.navigationBar.tintColor = UIColor.whiteColor()
But this doesn't seem to work. Any ideas?
Upvotes: 1
Views: 153
Reputation: 11
Code example below:
[[UINavigationBar appearance] setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor]},NSFontAttributeName: UIFont(name: "Avenir", size: 24)];
Upvotes: 1