在呈现新的UINavigationController时出现问题:在StatusBar下

时间:2018-06-07 09:17:23

标签: ios objective-c uiviewcontroller uinavigationcontroller statusbar

首先,我尝试从另一个ViewController呈现自定义UIViewController,但我遇到了StatusBar下显示的新UIViewController的问题。

其次,我决定将自定义UIViewController嵌入到新的UINavigationController中,然后展示此导航控制器。但是我遇到了与StatusBar相同的问题:

enter image description here

以下是我展示视图的代码:

MyCustomViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"myCustomViewController"];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:vc];
[navController setNavigationBarHidden:YES]; // I need nav bar to be hidden. Anyway,even if I don't hide it, the issue occur
[self presentViewController:navController animated:YES completion:nil];

此外,这里是故事板中的MyCustomViewController: enter image description here

谢谢

0 个答案:

没有答案