How can I get a UIWebView to focus on a form input and bring up the keyboard?

若如初见. 提交于 2019-11-28 09:24:27

This is now possible with iOS 6.

UIWebView* webView = <#your webView here#>;
[webView setKeyboardDisplayRequiresUserAction:NO];
[webView loadHTMLString:@"<html><head></head><body><form><input id=\"textField\" /></form><script>document.getElementById(\"textField\").focus();</script></body></html>"
                baseURL:nil];
theory

As soumya92 points out in the comment to the original post, this post finds that it's not possible at this time. Alas.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!