MFMessageComposer取消按钮在iOS 11中不可见

时间:2018-03-12 05:10:31

标签: swift ios11 mfmessagecomposeview

在iOS 11设备中看不到呈现消息编写器后右上角的取消按钮。如屏幕截图所示,取消按钮有效,但不可见。一旦我们按下它,屏幕就会消失。enter image description here

1 个答案:

答案 0 :(得分:0)

我试过这样的话:

myDict.function
  1. 添加了myDict.function()class ViewController: UIViewController, MFMessageComposeViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func Messages(_ sender: UIButton) { if MFMessageComposeViewController.canSendText() == true { let recipients:[String] = ["1500"] let messageController = MFMessageComposeViewController() messageController.messageComposeDelegate = self messageController.recipients = recipients messageController.body = "Your_text" self.present(messageController, animated: true, completion: nil) } else { //handle text messaging not available } } func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) { controller.dismiss(animated: true, completion: nil) } } 框架,并在视图控制器中导入。

  2. 截图:

  3. 图片enter image description here