6

我正在升级一个较旧的 iPad 框架,它是一个 splitView,主视图和详细视图均由 UINavigationControllers 控制。detailView 显示一系列 UIWebView。当用户触摸电子邮件按钮时,应用程序会以编程方式在 detailView 中调出标准电子邮件编写器表。这在 iOS6 设备上运行良好。工作表垂直向上滑动以覆盖导航栏并停在状态栏下方。在 iOS7 设备上,工作表在导航栏上向上滑动并覆盖状态栏。我尝试过的任何方法都无法阻止作曲家表覆盖 iOS7 中的状态栏。

这是电子邮件类的一部分的代码。委托是通过电子邮件按钮间接调用此方法的 UIViewController。

-(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];
}

感谢您提供有关如何防止作曲家表覆盖 iOS7 设备上的状态栏的任何建议。

4

0 回答 0