0

SWRevealViewController 在滑动时关闭键盘

问题是一样的,但这个答案对我没有帮助。

给定的链接中有一些解决方案。例如,我没有任何要删除的#if宏,并且在编写revealController.delegate = self;时出现错误。在AppDelegate.m

下面的委托方法永远不会被调用。

- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position
{
//Never get called
}

我搜索了互联网并做了给定链接中提到的所有事情。

我正在使用SWRevealViewController V 1.1.3 https://github.com/John-Lluch/SWRevealViewController/releases

问题是:我有一个UITextField内部 a ViewController,其行为类似于前视图。当我点击 时UITextField,键盘会出现,然后我滑动查看我ViewController的行为作为后视图,但键盘仍然存在,我无法隐藏它。

我怎样才能使它成为可能?

4

1 回答 1

0

我尝试使用 willMove 定位............但是,当键盘隐藏后不久后视图控制器弹出时,它会显示键盘............

对我来说,这非常有效....

func revealControllerPanGestureShouldBegin(revealController: SWRevealViewController!) -> Bool {
    self.view.endEditing(true)
    return true
}
于 2017-06-12T05:03:09.160 回答