MFMailComposeViewController

MFMailComposeViewController

本文介绍了iOS 7状态栏中的MFMailComposeViewController是黑色的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ios 7应用程序中有一个带有MFMailComposeViewController的反馈按钮。用户单击此按钮后,mailcomposer将打开,但状态栏将更改为黑色。有谁知道我该怎么办?

i have a feedback button in my ios 7 application with MFMailComposeViewController. After the user click this button the mailcomposer open but the statusbar changed to black. Have anybody a idea what can i do?

我只有ios7有这个问题。我为ios7自定义我的应用程序。

i have this problem only with ios7. i customizing my app for ios7.

    MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
            mailController.mailComposeDelegate = self;

            [mailController setSubject:@"Feedback"];
            // Fill out the email body tex
            NSString *emailBody = [NSString stringWithFormat:@"testest"],
                                   [UIDevice currentDevice].model,
                                   [UIDevice currentDevice].systemVersion];
            [mailController setMessageBody:emailBody isHTML:NO];
            [mailController setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];

            dispatch_async(dispatch_get_main_queue(), ^{
                [self presentModalViewController:mailController animated:YES];
}


推荐答案

在您的MFMailComposeViewController的presentViewController的完成块中设置UIApplication statusBarStyle。即

Set the UIApplication statusBarStyle in the completion block of presentViewController for your MFMailComposeViewController. i.e.

    MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init];
    [self.navigationController presentViewController:mailVC animated:YES completion:^{
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    }];

您可能还需要添加和/或在Info.plist文件中将查看基于控制器的状态栏外观设置为NO。

You may also need to add and/or set "View controller-based status bar appearance" to NO in your Info.plist file.

这篇关于iOS 7状态栏中的MFMailComposeViewController是黑色的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 04:38