本文介绍了为什么Android Webview显示“下一步"?仅当type ="number"时才在键盘上显示而不是type ="text"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一些输入字段的表格.因此,我想使用下一个按钮在各字段之间导航,但这仅在输入字段类型为数字"时才有效.使用type ="text"不会!

I have a form with a few input fields. So I want to navigate between the fields with the next button but that just works when the input field type is "number". With type="text" it doesn't!

这是Android 3.2.1中的错误吗?

Is this a bug in Android 3.2.1?

我的输入字段如下:

<input type="text" name="..." .... /> --> keyboard "Go"
<input type="text" name="..." .... /> --> keyboard "Go"
<input type="number" name="..." .... /> --> here it shows the "Next" button on the keyboard
<input type="text" name="..." .... /> --> keyboard "Go"

推荐答案

DennisA适用于Android 4.0及更低版本.

DennisA is right for Android 4.0 and below.

简而言之,这不是错误,而是可悲的是Google如何实现它(我希望所有这些键都具有一致的GO,以便您可以防止JavaScript中的默认操作).

In short this is not a bug but sadly how google implemented it (I would prefer a consistent GO for all those keys so you can prevent the default action in JavaScript).

在Android 4.1(JellyBean)中,您可以通过扩展WebViewInputConnection来更改默认行为: https://github.com/android /platform_frameworks_base/blob/master/core/java/android/webkit/WebViewClassic.java#L379

With Android 4.1 (JellyBean), you can change the default behavior by extending WebViewInputConnection:https://github.com/android/platform_frameworks_base/blob/master/core/java/android/webkit/WebViewClassic.java#L379

(涉及黑客行为)

这篇关于为什么Android Webview显示“下一步"?仅当type ="number"时才在键盘上显示而不是type ="text"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 01:34