我目前有一些困难,尝试设置取消和发送按钮的颜色,当我导航到MFMailComposeViewController在iOS 10使用swift 3.我试着设置MFMailComposeViewController的UINavigationController的色调,酒吧和项目没有成功。任何帮助将非常感激。设置导航栏项目颜色在MFMailComposeViewController
如何打开MFMailComposeViewController:
/* Open mail for the user to send a help emaail with questions about the app */
func sendEmail() {
if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self
mail.setToRecipients(["[email protected]"])
mail.navigationBar.tintColor = UIColor.blue
present(mail, animated: true)
}
}
/* Called when mail is dismissed */
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
controller.dismiss(animated: true)
}
尝试设置撰写控制器的视图本身的色调。 –
@LeoNatan在邮件对象的初始化之前尝试添加'self.navigationController?.navigationBar.tintColor = UIColor.blue',但它没有帮助。 – user3459799
号码试试'mail.view.tintColor = .blue' –