知道为什么当模态控制器在iPad上显示为UIModalPresentationFormSheet时,无法隐藏状态栏? 覆盖preferedStatusBarHidden不起作用
答案 0 :(得分:0)
您可以隐藏导航栏以抛出导航控制器。 例如使用:
[infoViewNavController setNavigationBarHidden:YES animated:NO];
infoViewNavController 是导航控制器,它将保存用于模态演示的viewController。
假设你这样称呼它:
UINavigationController *infoViewNavController =
[[UINavigationController alloc] initWithRootViewController:viewControllerToShow];
infoViewNavController.modalPresentationStyle = UIModalPresentationFormSheet;
infoViewNavController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[infoViewNavController setNavigationBarHidden:YES animated:NO];
self.navigationController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
self.navigationController .modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentViewController:infoViewNavController animated:YES completion:nil];