在自定义键盘ios8中关闭键盘无法正常工作

Jua*_*llo 5 ios ios8 ios-app-extension custom-keyboard

我在使用dismiss键盘方法在ios8中使用自定义键盘扩展时遇到了一些问题.

我打电话给:

[self dismissKeyboard];
Run Code Online (Sandbox Code Playgroud)

它编译好了,但是当我按下我的关闭按钮时它会崩溃并打开普通键盘.在控制台中,我只能看到接下来的几行:

2014-08-25 17:38:50.147 customkeyboards [2678:5567685]插件com.customkeyboards中断2014-08-25 17:38:51.248 customkeyboards [2678:5567651] viewServiceDidTerminateWithError :: Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3"无法完成.(_UIViewServiceInterfaceErrorDomain错误3.)"UserInfo = 0x7a8dd4c0 {Message = Service Connection Interrupted}

我正在使用ios 8 beta 6并将其运行到模拟器中.具有最新beta(ios5)的设备也是如此

Jua*_*llo 0

对于遇到同样问题的人,这里是解决它的代码!祝你好运!

[self.view endEditing:YES];

self.inputView.frame = CGRectMake( 0, 0, 0, 0 );
self.view.frame = CGRectMake( 0, 0, 0, 0 );
[self.inputView removeFromSuperview ];
[self.view removeFromSuperview ];
for (UIView *v in [self.inputView subviews]){
    [v removeFromSuperview];
}
for (UIView *v in [self.view subviews]){
    [v removeFromSuperview];
}

 [self dismissKeyboard];
Run Code Online (Sandbox Code Playgroud)