簡體   English   中英

在自定義鍵盤ios8中關閉鍵盤無法正常工作

[英]Dismiss keyboard in custom keyboard ios8 not working

我在使用dismiss鍵盤方法在ios8中使用自定義鍵盤擴展時遇到了一些問題。

我打電話給:

[self dismissKeyboard];

它編譯好了,但是當我按下我的關閉按鈕時它會崩潰並打開普通鍵盤。 在控制台中,我只能看到接下來的幾行:

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)的設備也是如此

對於任何有相同問題的人,這里是解決它的代碼! 祝好運!

[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];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM