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