【问题标题】:Incorrect with MFMailComposer AppearanceMFMailComposer 外观不正确
【发布时间】:2016-04-13 16:02:02
【问题描述】:

我正在努力将 sMFMailComposer 用于在我的应用中发送短信。下面是我创建和显示消息共享组件的代码:

- (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 navigationBar] setTintColor:[UIColor blackColor ]];

...但这没有任何效果。有谁知道为什么文本设置为白色,因此不可读?

【问题讨论】:

  • 您是否在您的代码中的任何地方全局更改了导航栏的色调颜色(例如在应用程序委托中)?

标签: ios mfmailcomposeviewcontroller mfmailcomposer


【解决方案1】:

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

shareWithMessage

也许以下 3 个中的一个可以解决问题:

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

【讨论】:

  • 嗯,好电话。我在AppDelegate 中全局设置外观。我在调用 ` [self presentViewController:messageController animated:YES completion:nil];, but it still got the same result. Similarly, I also tried [[messageController navigationBar] setTintColor:[UIColor blackColor ]];` 之前尝试了你的建议,但仍然没有。
猜你喜欢
  • 2012-03-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-04-28
相关资源
最近更新 更多