iOS 7状态栏中的MFMailComposeViewController是黑色的 [英] MFMailComposeViewController in iOS 7 statusbar are black

查看:89
本文介绍了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:@"support@test.com",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是黑色的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆