我目前有一些困難,嘗試設置取消和發送按鈕的顏色,當我導航到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' –