tags:

views:

182

answers:

2

I recently encountered very strange behaviour with the UIImagePickerController. On our main view we have a button that calls the image picker controller. If you hit cancel on the image picker, I simply dismiss the controller, and for some reason or another my main view moves down roughly about the height of the status bar (which is not turned off on the main view, left at default gray). Anyone else encounter this?

A: 

This problem is annoying, its been discussed before, check it out http://stackoverflow.com/questions/1186492/contents-of-uiscrollview-shifted-after-dismissing-modalviewcontroller/1195812#1195812

Daniel
A: 

Yeah I saw that post, and it didn't fix my issue. What I ended up doing was adding this in my app delegate before adding my first view to the window:

CGRect theRect = mainMenuController.view.frame;
float statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
theRect = CGRectOffset(theRect, 0.0,statusBarHeight);
mainMenuController.view.frame = theRect;

This fixed it completely.

Codezy