iPhone UIWebView becomeFirstResponder

Posted by user505618 on Stack Overflow See other posts from Stack Overflow or by user505618
Published on 2010-11-12T10:47:31Z Indexed on 2010/12/28 10:54 UTC
Read the original article Hit count: 346

Filed under:
|

I have an UIWebView with an <input type="text"/> html element in it. I want to focus the input element in the html and show the keyboard on the iPhone programmatically, without tapping the screen.

I've tried the following:

  • set the focus from JavaScript (in this case the onFocus JS event will fire but the keyboard won't show up)
  • [webView becomeFirstresponder] (returns NO)
  • set the first subview of the webView to be the firstResponder (returns NO)
  • subclass UIWebView to return YES to canBecomeFirstResponder: (nothing happens)

I'm trying to find the solution since yesterday but I couldn't find it. Please help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiwebview