2011-10-03 39 views

回答

3

是的,有:

UIModalPresentationFormSheet 

的宽度和所呈现的视图的高度比在屏幕的更小,并且视图居中在屏幕上。如果设备处于横向并且键盘可见,则会向上调整视图的位置,以便视图保持可见。所有未被覆盖的区域都会变暗,以防止用户与其进行交互。

例如:

UIViewController *viewController = [[UIViewController alloc] init]; 
viewController.modalPresentationStyle = UIModalPresentationFormSheet; 
[self presentModalViewController:viewController animated:YES]; 
viewController.view.superview.frame = CGRectMake(0, 0, 540, 500); // this is important to do this after presentModalView 
viewController.view.superview.center = self.view.superview.center; 
+0

绝对!非常感谢! – mineschan

+0

不客气。 – Nekto

相关问题