flagman
flagman

Reputation: 502

Hide keyboard in UIWebView

Is there a way to make a UIWebView dismiss all associated input controls, such as keyboards/pickers?

Upvotes: 3

Views: 4352

Answers (2)

Christopher Pickslay
Christopher Pickslay

Reputation: 17762

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

[theWebView endEditing:YES];

Upvotes: 9

flagman
flagman

Reputation: 502

    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 ;)

Upvotes: 2

Related Questions