Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios MFMailComposer外观不正确_Ios_Mfmailcomposeviewcontroller_Mfmailcomposer - Fatal编程技术网

Ios MFMailComposer外观不正确

Ios MFMailComposer外观不正确,ios,mfmailcomposeviewcontroller,mfmailcomposer,Ios,Mfmailcomposeviewcontroller,Mfmailcomposer,我正在努力合并sMFMailComposer,以便在我的应用程序中发送短信。下面是我创建和显示消息共享组件的代码: - (void)shareWithMessages { if(![MFMessageComposeViewController canSendText]) { UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@&quo

我正在努力合并s
MFMailComposer
,以便在我的应用程序中发送短信。下面是我创建和显示消息共享组件的代码:

- (void)shareWithMessages {
    
    if(![MFMessageComposeViewController canSendText]) {
        UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Your device doesn't support SMS!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [warningAlert show];
        return;
    }
    
    NSString *message = self.articleTitle;
    message = [message stringByAppendingString:@" "];
    message = [message stringByAppendingString:self.urlString];
    
    MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init];
    messageController.messageComposeDelegate = self;
    [messageController setBody:message];
        
    // Present message view controller on screen
    [self presentViewController:messageController animated:YES completion:nil];
}
显示共享生成器时,“新消息”文本显示为白色:

我试着这样设置色调颜色:

[[messageController导航栏]setTintColor:[UIColor blackColor]]


…但那没有效果。有人知道为什么文本被设置为白色,因此无法阅读吗?

可能在代码中的某个地方您正在更改[UINavigationBar外观]。因此,请在调用之前尝试设置UINavigationBar的外观

shareWithMessage
也许以下三种方法中的一种可以做到:

[[UINavigationBar appearance] setTintColor:[UIColor yourColor]];
[[UINavigationBar appearance] setBarTintColor:[UIColor yourColor]];
[[UINavigationBar appearance] setTitleTextAttributes:
     @{NSForegroundColorAttributeName:[UIColor yourColor]}];

您是否在代码中的任何位置全局更改导航条的色调(对于ex-in-app delegate)?嗯,很好。我正在
AppDelegate
中全局设置外观。在调用“[self-presentViewController:messageController animated:YES completion:nil]”之前,我尝试了您的建议<代码>,但仍然得到相同的结果。同样,我也尝试了
[[messageController navigationBar]setTintColor:[UIColor blackColor]];`,还是什么都没有。