具有自定义视图大小的UIModalPresentationStyle视图

问题描述

|| 当您选择\“ UIModalPresentationFormSheet \”时,是否可以具有视图的自定义大小?现在看来,这似乎超出了我们的控制范围? 根据以下链接,您似乎无法更改认大小。 http://www.thizzer.com/2011/05/uimodalpresentationstyle-frame-size-ipad/     

解决方法

        
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,200,200);//it\'s important to do this after 


targetController.view.superview.center = self.view.center;