ios - 我应该为 iPad UIModalPresentationFormSheet 使用 pushViewController 还是 presentModalViewController?

标签 ios ipad pushviewcontroller presentmodalviewcontroller uimodalpresentationstyle

在 UIModalPresentationFormSheet 的所有示例中,都使用了 presentModalViewController。但是,根据文档,presentModalViewController 已在 iOS 6.0 中弃用。但是我没有看到任何使用 pushViewController 显示 UIModalPresentationFormSheet 的示例。

我应该使用哪个?

最佳答案

首先,设置你的 Controller 的presentationStyle

 controllerToBePresented.modalPresentationStyle = UIModalPresentationFormSheet;

然后

[self presentViewController:controllerToBePresented animated:YES completion:^{
}];

关于ios - 我应该为 iPad UIModalPresentationFormSheet 使用 pushViewController 还是 presentModalViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21295668/

相关文章:

ios - 解码 JSON 响应

html - iOS7 Safari 地址栏在 iPad 模拟器中与页面内容重叠约 10 px

iphone - 在导航栏iPhone上设置自定义后退按钮,有时会在顶部显示后退按钮

iphone - 如何在IOS中动态调用类方法?

objective-c - 在 iPhone 上使用 UINavigationController 的 setViewController 行为不正常

ios - 更改 "Return"键盘按钮的文本

ios - Objective c SpriteKit 节点

iphone - 适用于 iOS 的文本阅读器 API

xcode - 我如何将模态转场(以编程方式)设置为推送转场