I have the following code which launches the iPad’s camera when the camera button on a UIToolBar is pressed. But whenever the view is dismissed, the toolbar doubles in hieght. I’m not sure why it is doing this. It just suddenly gets stretched up in height.
UIImagePickerController *pickerController = [[[UIImagePickerController alloc] init] autorelease];
pickerController.delegate = self;
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
pickerController.showsCameraControls = YES;
if (self.isProfileFlag)
{
//test
}
else
{
pickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypeCamera];
pickerController.showsCameraControls = YES;
}
[self.topLevelParent presentModalViewController:pickerController animated: false];
And to dismiss it, I have: picker dismissModalViewControllerAnimated:TRUE];
However, once I rotate the screen, the toolbar is back to normal until i open the camera again.
Jon,
I can’t say for sure based solely on the information that you have provided, but it seems like you bar is fixed when redrawn. So, and this is a dirt fix (you should try to figure out what is really happening) but you can try [jonsBar setNeedsDisplay] right after you dismiss the modal. This should redraw the toolbar.
One thing to look at is are you using a Nib for your layout or are you drawing your UI via code. I have seen some weird thing’s when drawing everything with code, but your mileage may vary.
If you can provide more detail, I may be able to help further, but do take a look at the above first.