Ios 在MFMailComposeViewController中禁用导航栏半透明性

Ios 在MFMailComposeViewController中禁用导航栏半透明性,ios,objective-c,xcode,uinavigationcontroller,mfmailcomposeviewcontroller,Ios,Objective C,Xcode,Uinavigationcontroller,Mfmailcomposeviewcontroller,我的第一个视图嵌入在导航控制器中,我将其半透明属性设置为“否”。这将为我提供所需的平坦绿色,状态栏为白色。但是,当我打开MFMailComposeViewController时,半透明属性被设置回“是”,状态栏变回黑色 如何删除半透明并将状态栏设置回白色?下面是我的代码 - (void)viewDidLoad { [super viewDidLoad]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame

我的第一个视图嵌入在导航控制器中,我将其半透明属性设置为“否”。这将为我提供所需的平坦绿色,状态栏为白色。但是,当我打开MFMailComposeViewController时,半透明属性被设置回“是”,状态栏变回黑色

如何删除半透明并将状态栏设置回白色?下面是我的代码

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
    [self.navigationController.navigationBar setTranslucent:NO];
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 1) {
        if (indexPath.row == 0) {
            NSArray *toRecipents = [NSArray arrayWithObject:@"email goes here"];
            MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
            mc.mailComposeDelegate = self;
            [mc.navigationBar setTintColor:[UIColor whiteColor]];

            [mc.navigationController.navigationBar setTranslucent:NO];

            [mc setSubject:@"Inquiry"];
            [mc setMessageBody:@"Hi, " isHTML:NO];
            [mc setToRecipients:toRecipents];
            [self presentViewController:mc animated:YES completion:NULL];
        }
    }
}
这对我很有效:

[[UINavigationBar appearance] setTranslucent:NO];