相关疑难解决方法(0)

iOS 10无法再在MFMessageComposeViewController上设置barcolor和色调

下面的代码适用于iOS 9.x或更低版本,由于某种原因,如果iOS 10不起作用

 if([MFMessageComposeViewController canSendText])
             {
                 controller.body = message;
                 NSString *tel = pContact.tlc;
                 controller.recipients = pContact.tlc?@[tel]:nil;
                 controller.messageComposeDelegate = self;
                 controller.navigationBar.tintColor = [UIColor whiteColor];
                 controller.navigationBar.barTintColor = [UIColor blueColor];
                 [self presentViewController:controller animated:YES completion:nil];
             }
Run Code Online (Sandbox Code Playgroud)

它是破碎还是做了一些改变.不知道这里遗漏了什么.我在黑暗中(漆黑)

编辑:我试图在一个新的空单视图项目上使用一些测试代码,我遇到了同样的问题.

@IBAction func SMS(_ sender: AnyObject) {
        let composeVC = MFMessageComposeViewController()
        composeVC.messageComposeDelegate = self

        // Configure the fields of the interface.
        composeVC.recipients = ["5555555555"]
        composeVC.body = "Hello from California!"
        composeVC.navigationBar.tintColor = UIColor.green
        composeVC.navigationBar.barTintColor = UIColor.purple
        // Present the view controller modally.
        self.present(composeVC, animated: true, completion: nil)
    } …
Run Code Online (Sandbox Code Playgroud)

colors uinavigationbar mfmessagecomposeviewcontroller

21
推荐指数
1
解决办法
3290
查看次数