Cocoa touch 使用modalPresentationStyle显示视图

Cocoa touch 使用modalPresentationStyle显示视图,cocoa-touch,ipad,view,popup,Cocoa Touch,Ipad,View,Popup,我听说你可以使用modalPresentationStyle在iPad的邮件应用程序中创建一个视图弹出窗口。不过,我很难想出如何使用它。我看了这篇文章,仍然不知道如何完成这项任务。如果有人能解释如何连接控制器以使代码正常工作,那就太好了 谢谢我认为魔法咒语如下: myViewController = ..... create your new controller if needed .... myViewController.modalTransitionStyle = UIModalTran

我听说你可以使用modalPresentationStyle在iPad的邮件应用程序中创建一个视图弹出窗口。不过,我很难想出如何使用它。我看了这篇文章,仍然不知道如何完成这项任务。如果有人能解释如何连接控制器以使代码正常工作,那就太好了


谢谢

我认为魔法咒语如下:

myViewController = ..... create your new controller if needed ....
myViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
// "self" here is a ViewController instance
[self presentModalViewController:myViewController animated:YES]

我似乎记得,在肖像画中,模态占据了屏幕;在景观中,它将以视图的中心显示。

好的,没关系。再次感谢你。现在想一想,你会如何“驳回”它?想出了如何驳回[someViewController驳回ModalViewController驳回:是];