1

我正在 iOS 8 上构建我的应用程序,当 UIViewController 显示 modalPresentationStyle = UIModalPresentationPageSheet 时,状态栏可见性出现问题。我阅读了文档,“modalPresentationCapturesStatusBarAppearance”的新 API 真实值用于在呈现模态演示时隐藏状态栏,但是在这个 modalPresentationStyle 中我没有得到任何结果。在我的应用程序中,我没有显示状态栏。它在 iOS 7 中使用这种风格效果很好,但在 iOS 8 中它会出现问题。这是我的代码:

UINavigationController  *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
nav.modalPresentationStyle = UIModalPresentationPageSheet;
nav.modalTransitionStyle=UIModalTransitionStyleCoverVertical;
nav.modalPresentationCapturesStatusBarAppearance = YES; // To hide status bar, doest work with UIModalPresentationPageSheet style
[self.navigationController presentViewController:nav animated:YES completion:NULL];

我是这样的:

在此处输入图像描述

但所需的输出是

在此处输入图像描述

请帮忙 !!

4

1 回答 1

0

nav.modalPresentationStyle = UIModalPresentationPopover仅使用

于 2014-09-19T06:58:52.683 回答