3

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

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
flagman
  • 502
  • 4
  • 18

2 Answers2

9

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

[theWebView endEditing:YES];
Christopher Pickslay
  • 17,523
  • 6
  • 79
  • 92
2
    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 ;)

flagman
  • 502
  • 4
  • 18