简体   繁体   English

iOS 12.0:有没有办法将 MFMailComposeViewController 导航栏标题的文本设置为白色?

[英]iOS 12.0 : Is there a way to set MFMailComposeViewController navigation bar title's text to white?

Currently, I haven't found a way to do this for iOS 12.0.目前,我还没有找到针对 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.我尝试了在 StackOverflow 上找到的更多选项,但都没有奏效。 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.栏按钮的颜色正确更改,但导航栏标题没有正确更改。

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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MFMailComposeViewController的导航栏中的ios 11问题 - ios 11 issue in MFMailComposeViewController's navigation bar iOS 8.3:为什么MFMailComposeViewController的导航栏背景颜色仍然是白色? - iOS 8.3 : Why is the navigation bar background color for MFMailComposeViewController still white? 在MFMailComposeViewController中更改导航栏标题 - Changing navigation bar title in MFMailComposeViewController 如何在导航栏标题文本上设置搜索栏的文本? - How to set Search Bar's text on Navigation Bar Title Text? iOS:如何将导航栏标题文本从粗体设置为细体 - iOS: How to set the navigation bar title text from bold to thin 导航栏标题背景在iOS11中是白色的 - Navigation Bar Title background is white in iOS11 如何为UIPopOverController的导航栏设置标题? - How to set title to UIPopOverController's Navigation Bar? 如何使MFMailComposeViewController的状态栏具有白色文本(LightContent)? - How do I make MFMailComposeViewController's status bar have white text (LightContent)? iOS:表格视图的标题栏被导航栏意外覆盖 - iOS: table view's title bar covered by navigation bar unexpectedly 出现视图时,iOS导航栏标题的动态设置会在文本中产生省略号 - iOS Navigation Bar Title set dinamically is making a ellipsis in text when view appears
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM