17

Currently, I haven't found a way to do this for iOS 12.0. I've tried setting bar tint like so.

[mailController.navigationBar setTintColor:[UIColor whiteColor]];

Then, I tried setting the title text attribute with the following code

   [mailController.navigationController.navigationBar setTitleTextAttributes:
 @{NSForegroundColorAttributeName:[UIColor WhiteColor]};

I've tried more options that I found on StackOverflow, but none of them worked. I am hoping that someone found a reliable way to change the navigation bar title text color. It stays black no matter what I do. The bar button's colors change correctly, but not the navigation bar title.

Curt Rand
  • 1,025
  • 1
  • 9
  • 27
  • FYI - This same issue is being discussed at https://stackoverflow.com/questions/52522308/change-title-color-of-navigation-bar-in-mfmailcomposeviewcontroller-in-ios-12-no – rmaddy Sep 27 '18 at 02:38

1 Answers1

1

Can you please try either one of these which lets you set the navigation bar color. For example: If the navigation bar is black color, then the text is set to white.

[[UINavigationBar appearance] setBarStyle: UIBarStyleBlack]

or

[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]

MobileDev
  • 151
  • 1
  • 6