0
iPad上有這樣的模型視圖嗎?在Cocoa-Touch Framework中,iPad中是否有任何模式視圖?
iPad上有這樣的模型視圖嗎?在Cocoa-Touch Framework中,iPad中是否有任何模式視圖?
是的,有:
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;
絕對!非常感謝! – mineschan
不客氣。 – Nekto