3

有没有办法让 UIWebView 关闭所有关联的输入控件,例如键盘/选择器?

4

2 回答 2

9

没有在带有选择器的网络视图中尝试过,但这绝对可以消除键盘:

[theWebView endEditing:YES];
于 2012-06-13T20:46:03.160 回答
2
    for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows])
    for (UIView *keyboard in [keyboardWindow subviews])

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

肮脏的方式,但它的工作原理;)

于 2010-08-02T07:53:53.787 回答