MFMailComposeViewController 导航栏中的 ios 11 问题 [英] ios 11 issue in MFMailComposeViewController's navigation bar

查看:30
本文介绍了MFMailComposeViewController 导航栏中的 ios 11 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的代码来呈现一个 MFMailViewController.一切正常,直到 ios 11 发布.

I used below code to present a MFMailViewController. Everything worked perfectly until ios 11 release.

                let mailViewController = MFMailComposeViewController()
                mailViewController.mailComposeDelegate = self               
                mailViewController.setToRecipients(nil)
                mailViewController.setSubject("Subject")
                mailViewController.navigationBar.tintColor = UIColor.green
                UINavigationBar.appearance().isTranslucent = false
                self.present(mailViewController, animated: true, completion:  nil)

无论我使用什么代码,都不起作用.我能够展示一个控制器,但导航栏的色调颜色没有改变.此问题仅适用于 ios 11.我已将整个应用程序导航栏的色调颜色设置为白色.因此在控制器中我得到白色而不是绿色.

No matter what code I use, nothing is working. I am able to present a controller , but navigation bar tint color is not changing. This issue is only with ios 11. I have set overall app navigation bar tint color to white. Hence in controller I get white tint color not green.

推荐答案

我终于找到了问题所在.我在其中一个文件中全局修改了 UIBarButton.

I finally found what was wrong. I globally modified UIBarButton in one of the file.

UIBarButtonItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.theme, NSFontAttributeName : UIFont.regularAppFontOfSize(0.0)], for: UIControlState.normal)

即使我使用了 mailViewController.navigationBar.tintColor = UIColor.green ,由于全局修改,它没有任何效果.

Even though I used mailViewController.navigationBar.tintColor = UIColor.green , because of global modification , it didn't have any effect.

但令人惊讶的是,在 ios 10 及以下版本中没有问题,但在 ios 11 中.

But what's surprising is, there was no problem in ios 10 and below, but in ios 11.

如果有人知道原因,不胜感激.

If any one know the reason, its appreciated.

这篇关于MFMailComposeViewController 导航栏中的 ios 11 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆