When I dismiss my Modal View to return to the Navigation Controller View I get this strange behavior with my StatusBar

I use [[UIApplication sharedApplication] setStatusBarHidden:YES]; in the ViewDidLoad for my Modal View and I use [[UIApplication sharedApplication] setStatusBarHidden:NO]; in my NavController View.
Any ideas on how can I prevent this?
Thanks in advance!
Try to move the code to viewDidDisappear method of the modal view controller that you present:
Further explanation: the old view get displayed in the window too late, at the time the old view is redisplayed the status bar still hidden, so the uiview of the old controller will get the full size of the widow (that does not have the statusbar) leading in the 20 px shifting that appear in the upper part of the view