【发布时间】:2018-07-14 10:22:39
【问题描述】:
这是我的代码
let selectRoute = UIAlertController(title: "Select a Route", message: "Please select the route you want to create your trip on", preferredStyle: .actionSheet)
let route1 = UIAlertAction(title: "Route 1", style: .default) { (action) in
self.reminder()
self.routeID = 1
self.tableView.reloadData()
}
let route2 = UIAlertAction(title: "Route 2", style: .default) { (action) in
}
selectRoute.addAction(route1)
selectRoute.addAction(route2)
if let popoverPresentationController = selectRoute.popoverPresentationController {
popoverPresentationController.sourceView = self.view
popoverPresentationController.sourceRect = self.view.bounds
}
self.present(selectRoute, animated: true, completion: nil)
当我运行这个时,actionSheet 只是出现在导航控制器上,非常小,有人知道解决方法吗?
【问题讨论】:
-
你如何展示
UIAlertController? -
让我猜猜:iPad 崩溃了,不是吗?你找到错误了吗?
-
@Larme 是线程 1 信号 sigabrt 错误
-
您是否尝试显示警报或操作表,因为
UIAlertController可以同时执行这两种操作?警报不会生成错误,但操作表会生成错误,因为它需要锚定到错误指示的内容。 -
@UpholderOfTruth 行动表
标签: swift swift4 uialertcontroller