创建:2012.03.16You are able to adjust the frame of a modal view after presenting it:
MyModalViewController *targetController = [[[MyModalViewController alloc] init] autorelease];
targetController.modalPresentationStyle = UIModalPresentationFormSheet;
targetController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; //transition shouldn't matter
[self presentModalViewController:targetController animated:YES];
targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after presentModalViewController
targetController.view.superview.center = self.view.center;//self.view assumes the base view is doing the launching, if not you might need self.view.superview.center etc.
It works also for me on iPad, but... If I rotate the device, the view is not centered – Mauro Delrio Aug 25 '11 at 17:56
@MauroDelrio To make it work correctly from landscape you need to flip the center coordinates. ex:
CGPoint center = self.view.center; targetController.view.superview.center = {isPortrait} ? center : CGPointMake(center.y, center.x);
– Nate Weiner Jan 6 at 1:36
+++++