I have a UIViewController
with no status bar, and it launches a second UIViewController
that has a status bar.
If the extended status bar is active, both views show correctly, but when I exit the second view and go back to the first, I see a 20pt black bar at the top and the whole view is pushed down, obscuring the bottom.
I tried resetting the frame to origin 0,0 in viewDidAppear
but it has no effect.
Why is the view pushed down and how can I fix it?
- (BOOL)prefersStatusBarHidden {
return YES;
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
self.view.frame = CGRectMake(0, 0, self.width, self.height);
self.view.backgroundColor = [UIColor redColor];
}
- (void)openShare {
Share *share = [[Share alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:share];
nav.modalTransitionStyle = UIModalPresentationPopover;
[self presentViewController:nav animated:YES completion:nil];
}
top of the view before openShare
is called:
top of the view after Share
is presented and dismissed: