1

I have a UIWebView in which there is nothing but an contenteditable div. I want to auto-show the keyboard when the viewcontroller is loaded.

I have googled a solution using

[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('content').focus()"];

But it does not work on my phone, which runs iOS 7.

I noticed the Evernote app, which makes the keyboard auto-showed, so I believe there is some method.

Could anyone help?

1 Answer 1

0

You could try setting the first responder on the uiwebview in viewWillAppear

[self.myWebView becomeFirstResponder];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.