我有一个 segue 类型是模态的,我将它的 presentationstyle 设置为 formsheet。
这是屏幕截图。
当我点击变暗的 View 时,“弹出窗口” View 不会自行消失。在模态视图外部点击时是否有任何技巧可以自行消失?
最佳答案
这可以通过使用 UIViewController
中的 UIPopoverController
类和 modalInPopover
属性来实现。将 modalInPopover
设置为 true 原因拥有的弹出 Controller 在显示时禁止在此 View Controller 之外进行交互。默认值为 false。 Here is the full doc.
关于swift - 如何关闭模态视图之外的 modalView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26796438/