If an element in a UIWebView has the style property -webkit-user-modify:read-write, then pressing on the element causes the keyboard to appear. Is it possible to bring up the keyboard programatically?
Thanks
If an element in a UIWebView has the style property -webkit-user-modify:read-write, then pressing on the element causes the keyboard to appear. Is it possible to bring up the keyboard programatically?
Thanks
From iOS Developer Library:
I doubt that calling
[webView becomeFirstResponder]
will bring up the keyboard as long as no HTML element with the required style has the focus. So your real problem might be to set the focus in your HTML document to an element programmatically. I would try to do this via Javascript. Something like this might work:It looks like in iOS6 now you can do this with "keyboardDisplayRequiresUserAction":
keyboardDisplayRequiresUserAction A Boolean value indicating whether web content can programmatically display the keyboard.
@property (nonatomic) BOOL keyboardDisplayRequiresUserAction Discussion When this property is set to YES, the user must explicitly tap the elements in the web view to display the keyboard (or other relevant input view) for that element. When set to NO, a focus event on an element causes the input view to be displayed and associated with that element automatically.
The default value for this property is YES.
Availability Available in iOS 6.0 and later. Declared In UIWebView.h
reference: