2011-10-03 41 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

相關問題