如何关闭UIWebView上的键盘? [英] How to dismiss keyboard on a UIWebView?

查看:186
本文介绍了如何关闭UIWebView上的键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载具有表单的HTML页面。我想在用户点击GO或点击HTML页面上的SUBMIT按钮时可以关闭键盘。

I am loading an HTML page that has a form. I would like to be able to dismiss the keyboard when the user clicks on GO or if he clicks on the SUBMIT button on the HTML page.

如果用户决定

不知道如何做到这一点。

Not sure how to do this.

推荐答案

您可以使用javascript使焦点离开HTML文本字段使用模糊:

You can use javascript to take the focus away from the HTML text field using blur:

document.foo.bar.myinput.blur();

这篇关于如何关闭UIWebView上的键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆