首先,我尝试从另一个ViewController呈现自定义UIViewController
,但我遇到了StatusBar下显示的新UIViewController
的问题。
其次,我决定将自定义UIViewController
嵌入到新的UINavigationController
中,然后展示此导航控制器。但是我遇到了与StatusBar相同的问题:
以下是我展示视图的代码:
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:
谢谢