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

查看:71
本文介绍了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)],用于: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天全站免登陆