0

When a button is clicked, the end user is able to send an email. However the nav bar won't go away, and the email nav bar is hidden underneath the main one. Is there a way to hide the main one? This is the action that is called when the button is pressed:

-(void)goToEmail{
    if([MFMailComposeViewController canSendMail]) {
        MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];
        mailCont.mailComposeDelegate = self;

        [mailCont setSubject:@"Hello!"];
        [mailCont setToRecipients:[NSArray arrayWithObject:@"name@email.com"]];
        [mailCont setMessageBody:@"Test" isHTML:NO];

        [self.navigationController setNavigationBarHidden:YES];
        [self presentModalViewController:mailCont animated:YES];
    }
}
4

1 回答 1

0

self.navigationController.navigationBar是邮件控制器的导航控制器。因此,您隐藏了电子邮件导航栏,而不是主要导航栏。您根本不必隐藏主要的。把那个电话 ( [self.navigationController setNavigationBarHidden:YES];) 拿出来看看你得到了什么。您应该会在另一个前面看到邮件控制器,并显示一个导航栏。主导航栏仍然可见,但会在后面。

于 2012-04-07T01:52:27.743 回答