使用Webview时在Android中禁用“开始"按钮表单提交 [英] Disabling 'go' button form submission in Android when using webview

查看:110
本文介绍了使用Webview时在Android中禁用“开始"按钮表单提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,并使用WebView将表单嵌入到我的应用程序中.我的问题是android有软键盘,当用户在此键盘上按"go"时,它将提交表单.如何防止这种情况发生?我在Google上进行了强力搜索,但没有找到任何解决方案.

I'm developing an Android application and I use a WebView to embed forms into my application. My problem is that android has a soft keyboard and when the user presses 'go' on this keyboard it submits the form. How can I prevent this from happening? I did a power search on google but I did not find any solutions.

推荐答案

好的,与此同时,我得到了一个非常简单的解决方案: 在清单XML中:

Ok in the meantime i got a very simple solution: In the manifest XML:

<activity android:name="..."
...
android:imeOptions="actionSend|flagNoEnterAction"
...
</activity>

通过这种方式,执行"按钮被替换为完成",并且隐藏了键盘.

This way the 'go' button got replaced by 'done' and it hides the keyboard.

这篇关于使用Webview时在Android中禁用“开始"按钮表单提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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