Navigation bar overlaps with status bar

I ran into a very strange problem on iOS 6.0

and iOS 6.0.1

.

Whenever I present a modal view from any view controller and then dismiss that modal view, my parent view controller's navigation bar (from where I presented the modal view) overlaps the status bar. This works great on simulators iOS 6.0

and iOS 6.1

but on devices it messes up.

My Xcode version is 4.6.

This is how I represent my Modal:

UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:iViewController];
[aNavigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self presentModalViewController:aNavigationController animated:YES];
[aNavigationController release];

      

This is how I fire Modal:

[self dismissModalViewControllerAnimated:YES];

      

Please see the attached screenshot of my navbar after modality rejection:

enter image description here

+3


source to share


1 answer


I corrected myself. This happened because when my RootViewController fires it, it is held on turns until the animation is done. Once this is done, it will start spinning again. The problem was that it was returning NO for all aspects (including the portrait). The view seemed beautiful, but when I imagined the modal and the return, the geometry of the view was distorted. Once I changed it to return YES for portrait mode even during animation, the problem went away.



- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)iOrientation {
    return (iOrientation == UIInterfaceOrientationPortrait);
}

      

+3


source







All Articles