如何强制键盘与数字在Android手机网站键盘、数字、手机网站、Android

2023-09-12 10:58:50 作者:苦笑流年记忆

我有一个移动网站,它有一些HTML 输入它元素,像这样的:

<输入类型=文本名称=txtAccessoryCost大小=6/>

我已经嵌入网站成为一个 的WebView 的可能的Andr​​oid 2.1的消费,因此,它也将是一个Android应用程序。

是否有可能获得键盘与数字,而不是默认的字母时,此HTML 输入元素的重点是?

或者,是否可以将其设置为整个应用程序(或许真的在清单文件),如果它不是一个HTML元素是否可行?

解决方案

 <输入类型=数字/>
<输入类型=电话/>
 

这两个present数字键盘在输入获得焦点。

<输入类型=搜索/> 显示了普通键盘有一个额外的搜索按钮

一切似乎调出标准键盘。

虚拟键盘触屏 2代Google手机09年问世

I have a mobile website and it has some HTML input elements in it, like this:

<input type="text" name="txtAccessoryCost" size="6" />

I have embedded the site into a WebView for possible Android 2.1 consumption, so that it will also be an Android application.

Is it possible to get the keyboard with numbers instead of the default one with letters when this HTML input element is focused?

Or, is it possible to set it for the whole application (maybe something in the Manifest file), if it is not feasible for an HTML element?

解决方案

<input type="number" />
<input type="tel" />

Both of these present the numeric keypad when the input gains focus.

<input type="search" /> shows a normal keyboard with an extra search button

Everything else seems to bring up the standard keyboard.