views:

40

answers:

2

Hi,

I'm working on a pretty simple iPhone app at the moment. I have a UIWebView with a UIToolBar at the bottom of it with a button on it. I've built it all through code, although I did create an empty NIB as I am hoping to get Facebook Connect working with it eventually and have had problems when I don't set it up with this empty NIB in the past...

I've added another button that just kind of sits in the middle of the page (for testing purposes while I build) that calls a UIActionSheet. When you select a button on the UIActionSheet, I have the UIImagePickerController popping up on top of everything, in order to select an image from my Camera Roll.

The problem is that when my UIImagePickerController has closed (either by selecting an image or by pressing the cancel button), all of the content on my page has been pushed down by 20 pixels...

While it is true that I could just shift the frames of all of my elements up by 20 pixels, that feels "hacky", and while I love to hack, I'd rather figure out why this is going on.

Has anyone ever encountered this? How did you fix it?

Thank you,

--d

A: 

Is your app a full screen app? UIImagePickerController makes the status bar appear. Make the method that dismisses UIImagePickerController hide the status bar also.

jamihash
My current app is not full screen, unfortunately, the status bar will be there at all times through the app...
dewberry
A: 

I'm having a similar issue with using the MFMailComposeViewController. When I dismiss it it causes the screen to move down 20 pixels.

I'm guessing it has something to do with IB, as mine has been acting up a bit recently. It thinks there is a status bar in my view even though there are none specified. Until I find the proper solution I'm using CGRectMake to 'fix' the problem.

I place the following code at the bottom of the didFinishWithResult method. This is the method called when I dismiss the MFMailComposeViewController. You could probably place the same code when you dismiss the UIImagePickerController.

self.view.frame = CGRectMake(0, 0, 320, 480);

if you find out the proper solution id love to know it :)

bennythemink