2011-06-14 103 views

回答

3
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 


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

如果我已經通過界面生成器設置的視圖框的大小? – itsaboutcode 2011-06-14 12:56:22

+0

默認情況下,UIModalPresentationStyle將使用默認的frame.after呈現後,我們可以根據需要更改它 – 2011-06-14 13:00:17