在外部点击时忽略由LMAlertView创建的alertview

时间:2016-10-19 15:42:09

标签: ios objective-c

我使用LMAlertView自定义了GIF http://imgur.com/a/Bu8PR

中显示的AlertView

问:如何在外面点击这个警报视图?

我尝试了Dismiss modal view form sheet controller on outside tap中显示的一些解决方案。

AlertView被code解雇,但视图也失去控制并收到错误消息

Unbalanced calls to begin/end appearance transitions for <LMEmbeddedViewController: 0x12fd03bf0>.

对于上述错误,我尝试将[self dismissViewControllerAnimated:YES completion:nil];动画形式设置为“是”或使用dispatch_async(dispatch_get_main_queue(), ^{包含[self dismissViewControllerAnimated:YES completion:nil];,但仍然无效。

解决方案:

[[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];

1 个答案:

答案 0 :(得分:0)

解决方案:

[[self presentingViewController] dismissViewControllerAnimated:YES 
completion:nil];