Hide keyboard in UIWebView

跟風遠走 提交于 2019-12-03 00:49:10

Haven't tried it in a web view with a picker, but this definitely works to dismiss the keyboard:

[theWebView endEditing:YES];
    for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows])
    for (UIView *keyboard in [keyboardWindow subviews])

        if([[keyboard description] hasPrefix:@"<UIFormAssistant"] == YES)
        {
            [keyboard removeFromSuperview];
        }

Dirty way but it works ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!