MFMessageComposeViewController ios7 covers the status bar
Asked Answered
E

0

6

I'm upgrading an older iPad framework that is a splitView with both master and detail views controlled by UINavigationControllers. The detailView displays a series of UIWebViews. When the user touches an email button, the app programmatically brings up the standard email composer sheet in the detailView. This works fine on an iOS6 device. The sheet slides up vertically to cover the navigationBar and stops below the status bar. On an iOS7 device the sheet slides up and over the navigationBar and covers the status bar. Nothing I've tried keeps the composer sheet from covering the status bar in iOS7.

Here's the code which is part of an email class. The delegate is the UIViewController that called this method indirectly via the email button.

-(void)displayComposerSheet {

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];

picker.navigationBar.barStyle = UIBarStyleBlackOpaque;
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
    picker.navigationBar.barStyle = UIBarStyleBlackTranslucent;
}

picker.modalPresentationStyle = UIModalPresentationCurrentContext;
picker.modalPresentationCapturesStatusBarAppearance = YES;

picker.mailComposeDelegate = self;

NSString *emailAddress = ruleEmailAddress;

// Set up recipients
NSArray *toRecipients = @[emailAddress];
[picker setToRecipients:toRecipients];
[picker setSubject:ruleNumber];
[picker setMessageBody:ruleText isHTML:YES];

[(UIViewController *)delegate presentViewController:picker animated:YES completion:nil];
}

Thanks for any suggestions on how to keep the composer sheet from covering the status bar on iOS7 devices.

Ellmyer answered 1/10, 2013 at 16:2 Comment(1)
Is there any specific reason to make the navigation bar style to translucent? May be that is what making the problem I guess.Coition

© 2022 - 2024 — McMap. All rights reserved.