我正在寻找一种方法来实现这种弹出框。
是否有基本的 iOS 命令来生成这种样式,而不是我们在 XCode 中看到的通常的 Arrow + Border 弹出框?或者是否有 API 可以做这种事情。
弹出框从屏幕底部出现,就像有时在 App Store 动画中一样。
谢谢
你想要做的是创建一个自定义UIVIewController
的模态演示样式设置为UIModalPresentationFormSheet
:
YourCustomViewController *customVC = [[YourCustomViewController alloc] initWithNib:@"YourCustomViewController" bundle:nil];
customVC.modalPresentationStyle = UIModalPresentationFormSheet;
[self self presentViewController:customVC animated:YES completion:nil];
您还必须创建一个工具栏并使用“关闭”或“完成”按钮正确格式化它,该按钮将关闭视图控制器