Problem: My status bar appears on top of navigationBar
after I present and dismiss MFMailComposerViewController
as modal view.
-(IBAction)openMail:(id)sender
{
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:emailTitle];
[mc setMessageBody:messageBody isHTML:YES];
[mc setToRecipients:toRecipents];
[mc.navigationItem.leftBarButtonItem setTintColor:[UIColor colorWithRed:144/255.0f green:5/255.0f blue:5/255.0f alpha:1.0f]];
[self presentViewController:mc animated:YES completion:NULL];
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
// Reset background image for navigation bars
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigationBar.png"] forBarMetrics:UIBarMetricsDefault];
NSLog(@"%@",[GGStackPanel printFrameParams:self.view]);
// Close the Mail Interface
GGAppDelegate * appDel = [[UIApplication sharedApplication] delegate];
HHTabListController * contr = (HHTabListController*)appDel.viewController;
[contr setWantsFullScreenLayout:NO];
NSLog(@"%i",[contr wantsFullScreenLayout]);
[self dismissViewControllerAnimated:YES completion:NULL];
}
There are couple of similar questions on Stackoverflow, but none of the solutions suggested there work for me. I have already tried:
status bar and Navigation bar problem after dismissed modal view
http://developer.appcelerator.com/question/120577/nav-bar-appears-underneath-status-bar
I tried presenting and dismissing from AppDelegate, no help.
Changing the view frame or navigationBar frame works, but I would have to do the same thing for all other views in my app (there are many of them). That will make my whole app depend on this tiny bug.
Screenshots
After dismissing MailComposer: