Search code examples
ipadmodal-dialogpresentationuimodalpresentationformsh

UIModalPresentationFormSheet resizing view


I am interested to know on how I can resize the view when using UIModalPresentationFormSheet of modalPresentationStyle, it looks like it has a fixed size so I was wondering if anyone out there did managed to manipulate the popup view from the sizing perspective.

So there is either UIModalPresentationFormSheet with a fixed view size or full views and I am after something in between.


Solution

  • MyModalViewController *targetController = [[[MyModalViewController alloc] init] autorelease]; 
    
    targetController.modalPresentationStyle = UIModalPresentationFormSheet;
    
    targetController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    
    [self presentModalViewController:targetController animated:YES];
    
    // it is important to do this after presentModalViewController:animated:
    targetController.view.superview.bounds = CGRectMake(0, 0, 200, 200);