我正在使用 UIPresentationController
来显示自定义模式。演示 Controller 有一个 UIView
调光 View ,在显示时动画进出。模式本身是一个添加到展示 Controller 容器中的 UIViewController
。
问题
我只能从嵌入式 UIViewController 调用 [self dismissViewControllerAnimated:NO completion:nil]
。但是我不能从 UIPresentationController
做同样的事情。但这就是调暗 View 的地方。
我想避免向模式添加额外的不可见 View ,或者尽可能使用 NSNotificationCenter
。
如何通过点击其变暗 View 来关闭 UIPresentationController
?是否有意义?可能吗?
最佳答案
好的,我找到了。您可以通过 self.presentedViewController
[self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
关于ios - 如何通过点击其调暗 View 来关闭 UIPresentationController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34308425/