【问题标题】:How to create a popover coming from bottom of the screen for iPad如何为 iPad 创建来自屏幕底部的弹出框
【发布时间】:2013-03-11 22:46:38
【问题描述】:

我正在寻找一种方法来实现 这种弹出框。

是否有基本的 iOS 命令来生成这种样式,而不是我们在 XCode 中看到的通常的 Arrow + Border 弹出框?或者有没有 API 可以做这种事情。

弹出框从屏幕底部出现,就像有时在 App Store 动画中一样。

谢谢

【问题讨论】:

  • 我认为这只是一个 modalPresentationStyle 设置为 UIModalPresentationFormSheet 的模态 UIViewController
  • 天哪,我看错地方了。。谢谢!
  • 我在下面的答案中写了更多

标签: ios xcode ipad popover


【解决方案1】:

您要做的是创建一个自定义UIVIewController,并将模态演示样式设置为UIModalPresentationFormSheet

YourCustomViewController *customVC = [[YourCustomViewController alloc] initWithNib:@"YourCustomViewController" bundle:nil];

customVC.modalPresentationStyle = UIModalPresentationFormSheet;

[self self presentViewController:customVC animated:YES completion:nil];

您还必须创建一个工具栏并使用“关闭”或“完成”按钮正确格式化它,这将关闭视图控制器

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-30
    • 2014-09-18
    • 1970-01-01
    • 2023-01-30
    • 1970-01-01
    • 1970-01-01
    • 2012-09-17
    相关资源
    最近更新 更多