0

I am using UIModalPresentationFormSheet and opening UIImagePickerController (or any UIViewController) but size of UIModalPresentationFormSheet changes when dismissing the UIImagePickerController or any other controller

modalViewController *changeProfilePicture = [[ModalViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[mainViewController presentModalViewController:navigationController animated:YES];
navigationController.view.superview.frame = CGRectMake((CGRectGetWidth(mainViewController.view.bounds)-300)/2, (CGRectGetHeight(mainViewController.view.bounds)-300)/2, 300, 300);

In modalViewController I am opening UIImagePickerController for pick a image in FullScreen mode. then frame size of modalViewController become almost twice.

It was ok when open the UIImagePickerController in popoverview.

But here my requirement is like I also have to open some other viewController in FullScreen mode.

Any Idea how we maintain the modalViewController frame size as it is.

Amit Battan
  • 2,968
  • 2
  • 32
  • 68

1 Answers1

0

I'd suggest getting the frame size of your parent view with self.frame and transfer it to the UIImagePicker you're having a problem with. That should cut down the size.

ATaylor
  • 2,598
  • 2
  • 17
  • 25
  • Thanks Taylor, What you want to say. Should I reduce the size of UIImagePicker or anything else. – Amit Battan Jul 19 '12 at 10:02
  • Yes, I think you should change the size of the UIImagePicker...after all that is, what's 'bloating' your modalView frame, isn't it? On a side note, you may want to save the current Rect to a variable, so you can 'reset' the size to what it was after adding the UIImagePicker. Go ahead, try it and then tell me how...or if it worked :) – ATaylor Jul 19 '12 at 10:11